From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Beomho Seo <beomho.seo@samsung.com>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org,
j.anaszewski@samsung.com, sachin.kamat@linaro.org,
ch.naveen@samsung.com, ktsai@capellamicro.com,
t.figa@samsung.com, myungjoo.ham@samsung.com,
jh80.chung@samsung.com, cw00.choi@samsung.com
Subject: Re: [PATCH 4/5] iio: light: gp2ap020a00f: Use devm_* APIs
Date: Wed, 18 Jun 2014 07:51:52 -0700 [thread overview]
Message-ID: <53A1A788.2030109@linux.intel.com> (raw)
In-Reply-To: <1403072503-29246-5-git-send-email-beomho.seo@samsung.com>
On 06/17/2014 11:21 PM, Beomho Seo wrote:
> This patch changes APIs from request_threaded_irq()
> and iio_device_register() to devm_* APIs. Using them make simpler.
> Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
> ---
> drivers/iio/light/gp2ap020a00f.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c
> index 221ed16..1745c6a 100644
> --- a/drivers/iio/light/gp2ap020a00f.c
> +++ b/drivers/iio/light/gp2ap020a00f.c
> @@ -1562,7 +1562,7 @@ static int gp2ap020a00f_probe(struct i2c_client *client,
> }
>
> /* This needs to be requested here for read_raw calls to work. */
> - err = request_threaded_irq(client->irq, NULL,
> + err = devm_request_threaded_irq(&client->dev, client->irq, NULL,
> &gp2ap020a00f_thresh_event_handler,
> IRQF_TRIGGER_FALLING |
> IRQF_ONESHOT,
> @@ -1581,10 +1581,10 @@ static int gp2ap020a00f_probe(struct i2c_client *client,
> err = iio_trigger_register(data->trig);
> if (err < 0) {
> dev_err(&client->dev, "Failed to register iio trigger.\n");
> - goto error_free_irq;
> + goto iio_uninit_buffer;
> }
>
> - err = iio_device_register(indio_dev);
> + err = devm_iio_device_register(&client->dev, indio_dev);
Same here. driver remove needs to do some shutdown, so devm_xx is
probably not a good idea.
Thanks,
Srinivas
> if (err < 0)
> goto error_trigger_unregister;
>
> @@ -1592,8 +1592,6 @@ static int gp2ap020a00f_probe(struct i2c_client *client,
>
> error_trigger_unregister:
> iio_trigger_unregister(data->trig);
> -error_free_irq:
> - free_irq(client->irq, indio_dev);
> error_uninit_buffer:
> iio_triggered_buffer_cleanup(indio_dev);
> error_regulator_disable:
> @@ -1613,9 +1611,7 @@ static int gp2ap020a00f_remove(struct i2c_client *client)
> if (err < 0)
> dev_err(&indio_dev->dev, "Failed to power off the device.\n");
>
> - iio_device_unregister(indio_dev);
> iio_trigger_unregister(data->trig);
> - free_irq(client->irq, indio_dev);
> iio_triggered_buffer_cleanup(indio_dev);
> regulator_disable(data->vled_reg);
>
>
next prev parent reply other threads:[~2014-06-18 14:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 6:21 [PATCH 0/5] iio: Using devm_* APIs in some sensor drivers Beomho Seo
2014-06-18 6:21 ` [PATCH 1/5] iio: adc: exynos_adc: Use devm_* APIs Beomho Seo
2014-06-18 6:35 ` Sachin Kamat
2014-06-18 14:53 ` Srinivas Pandruvada
2014-06-18 19:50 ` Jonathan Cameron
2014-06-18 6:21 ` [PATCH 2/5] iio: light: cm32181: " Beomho Seo
2014-06-18 8:20 ` Sachin Kamat
2014-06-21 11:44 ` Jonathan Cameron
2014-06-18 6:21 ` [PATCH 3/5] iio: light: cm36651: " Beomho Seo
2014-06-18 14:50 ` Srinivas Pandruvada
2014-06-18 6:21 ` [PATCH 4/5] iio: light: gp2ap020a00f: " Beomho Seo
2014-06-18 8:17 ` Sachin Kamat
2014-06-18 14:51 ` Srinivas Pandruvada [this message]
2014-06-18 6:21 ` [PATCH 5/5] iio: magnetometer: ak8975: " Beomho Seo
2014-06-21 11:43 ` Jonathan Cameron
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=53A1A788.2030109@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=beomho.seo@samsung.com \
--cc=ch.naveen@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=j.anaszewski@samsung.com \
--cc=jh80.chung@samsung.com \
--cc=jic23@kernel.org \
--cc=ktsai@capellamicro.com \
--cc=linux-iio@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=sachin.kamat@linaro.org \
--cc=t.figa@samsung.com \
/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.