All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Enric Balletbo Serra <eballetbo@gmail.com>
Cc: Vincent Palatin <vpalatin@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Benson Leung <bleung@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel@collabora.com
Subject: Re: [PATCH 2/6] mfd: cros_ec: free IRQ automatically
Date: Wed, 7 Mar 2018 15:18:02 +0000	[thread overview]
Message-ID: <20180307151802.lzibybov4qth6ksp@dell> (raw)
In-Reply-To: <CAFqH_53KekHzh_WGBN8WVFexb3DRCpu-pW4ffv3U0U7NUe99nw@mail.gmail.com>

On Tue, 20 Feb 2018, Enric Balletbo Serra wrote:

> Hi Vincent,
> 
> 2018-02-20 9:00 GMT+01:00 Vincent Palatin <vpalatin@chromium.org>:
> > On Mon, Feb 19, 2018 at 11:40 PM, Enric Balletbo i Serra
> > <enric.balletbo@collabora.com> wrote:
> >> From: Vincent Palatin <vpalatin@chromium.org>
> >>
> >> Free the IRQ we might have requested when removing the cros_ec device,
> >> so we can unload and reload the driver properly.
> >>
> >> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> >> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> >> ---
> >>  drivers/mfd/cros_ec.c | 17 ++++++-----------
> >>  1 file changed, 6 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
> >> index 74780f2964a1..d1a4fbee9380 100644
> >> --- a/drivers/mfd/cros_ec.c
> >> +++ b/drivers/mfd/cros_ec.c
> >> @@ -119,9 +119,9 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> >>         }
> >>
> >>         if (ec_dev->irq) {
> >> -               err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread,
> >> -                                          IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> >> -                                          "chromeos-ec", ec_dev);
> >> +               err = devm_request_threaded_irq(dev, ec_dev->irq, NULL,
> >> +                               ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> >> +                               "chromeos-ec", ec_dev);
> >>                 if (err) {
> >>                         dev_err(dev, "Failed to request IRQ %d: %d",
> >>                                 ec_dev->irq, err);
> >> @@ -135,7 +135,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> >>                 dev_err(dev,
> >>                         "Failed to register Embedded Controller subdevice %d\n",
> >>                         err);
> >> -               goto fail_mfd;
> >> +               return err;
> >>         }
> >>
> >>         if (ec_dev->max_passthru) {
> >> @@ -153,7 +153,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> >>                         dev_err(dev,
> >>                                 "Failed to register Power Delivery subdevice %d\n",
> >>                                 err);
> >> -                       goto fail_mfd;
> >> +                       return err;
> >>                 }
> >>         }
> >>
> >> @@ -162,7 +162,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> >>                 if (err) {
> >>                         mfd_remove_devices(dev);
> >>                         dev_err(dev, "Failed to register sub-devices\n");
> >> -                       goto fail_mfd;
> >> +                       return err;
> >>                 }
> >>         }
> >>
> >> @@ -180,11 +180,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> >>         cros_ec_acpi_install_gpe_handler(dev);
> >>
> >>         return 0;
> >> -
> >> -fail_mfd:
> >> -       if (ec_dev->irq)
> >> -               free_irq(ec_dev->irq, ec_dev);
> >> -       return err;
> >>  }
> >>  EXPORT_SYMBOL(cros_ec_register);
> >
> >
> > You need to remove the "free_irq(ec_dev->irq, ec_dev);" in cros_ec_remove() too.
> > as done there:
> > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/866858/15/drivers/mfd/cros_ec.c
> >
> > it was missing originally but was added by: 'f58b14e6632a mfd:
> > cros_ec: Free IRQ on exit'
> >
> 
> Many thanks to catch this. I'll wait a bit more for if I receive more
> feedback on the other patches and send a second version of this
> patchset.

Hmm... rather than mess around any further with this set, would you be
kind enough to pull all of the patches back into a single set and send
them out threaded with a cover-letter please?

I'm also going to un-apply 1/6 for completeness.

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2018-03-07 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 22:40 [PATCH 2/6] mfd: cros_ec: free IRQ automatically Enric Balletbo i Serra
2018-02-20  8:00 ` Vincent Palatin
2018-02-20  8:52   ` Enric Balletbo Serra
2018-03-07 15:18     ` Lee Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307151802.lzibybov4qth6ksp@dell \
    --to=lee.jones@linaro.org \
    --cc=bleung@chromium.org \
    --cc=eballetbo@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vpalatin@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.