From: Jonathan Cameron <jic23@kernel.org>
To: Naveen Krishna Chatradhi <ch.naveen@samsung.com>,
linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
dianders@chromium.org, gregkh@linuxfoundation.org,
naveenkrishna.ch@gmail.com, lars@metafoo.de, cpgs@samsung.com,
grundler@chromium.org, t.figa@samsung.com
Subject: Re: [PATCH 1/5 v3] iio: exynos_adc: use indio_dev->dev structure to handle child nodes
Date: Wed, 30 Apr 2014 21:43:45 +0100 [thread overview]
Message-ID: <53616081.1070806@kernel.org> (raw)
In-Reply-To: <1398850015-17761-2-git-send-email-ch.naveen@samsung.com>
On 30/04/14 10:26, Naveen Krishna Chatradhi wrote:
> From: Naveen Krishna Ch <ch.naveen@samsung.com>
>
> Using pdev->dev with device_for_each_child() would iterate over all
> of the children of the platform device and delete them.
> Thus, causing crashes during module unload.
>
> We should be using the indio_dev->dev structure for
> registering/unregistering child nodes.
>
> Signed-off-by: Naveen Krishna Ch <ch.naveen@samsung.com>
> Reported-by: Doug Anderson <dianders@chromium.org>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> Tested-by: Doug Anderson <dianders@chromium.org>
This one has been in my fixes-togreg branch for a few days and
a pull request has gone to Greg.
> ---
> Changes since v2:
> None
> Changes since v1:
> Adding Doug's tags
> v0:
> This change was tested on top of
> https://lkml.org/lkml/2014/4/21/481 from Doug.
>
> drivers/iio/adc/exynos_adc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index d25b262..affa93f 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -344,7 +344,7 @@ static int exynos_adc_probe(struct platform_device *pdev)
>
> exynos_adc_hw_init(info);
>
> - ret = of_platform_populate(np, exynos_adc_match, NULL, &pdev->dev);
> + ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev);
> if (ret < 0) {
> dev_err(&pdev->dev, "failed adding child nodes\n");
> goto err_of_populate;
> @@ -353,7 +353,7 @@ static int exynos_adc_probe(struct platform_device *pdev)
> return 0;
>
> err_of_populate:
> - device_for_each_child(&pdev->dev, NULL,
> + device_for_each_child(&indio_dev->dev, NULL,
> exynos_adc_remove_devices);
> regulator_disable(info->vdd);
> clk_disable_unprepare(info->clk);
> @@ -369,7 +369,7 @@ static int exynos_adc_remove(struct platform_device *pdev)
> struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> struct exynos_adc *info = iio_priv(indio_dev);
>
> - device_for_each_child(&pdev->dev, NULL,
> + device_for_each_child(&indio_dev->dev, NULL,
> exynos_adc_remove_devices);
> regulator_disable(info->vdd);
> clk_disable_unprepare(info->clk);
>
next prev parent reply other threads:[~2014-04-30 20:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-30 9:26 [PATCH 0/5 v3] iio: exynos_adc: fix minor nits in the driver Naveen Krishna Chatradhi
2014-04-30 9:26 ` [PATCH 1/5 v3] iio: exynos_adc: use indio_dev->dev structure to handle child nodes Naveen Krishna Chatradhi
2014-04-30 20:43 ` Jonathan Cameron [this message]
2014-04-30 9:26 ` [PATCH 2/5 v3] iio: exynos_adc: rearrange clk and regulator enable/disable calls Naveen Krishna Chatradhi
2014-04-30 20:44 ` Jonathan Cameron
2014-04-30 9:26 ` [PATCH 3/5 v3] iio: exynos_adc: reduce timeout and use wait_for_completion_timeout Naveen Krishna Chatradhi
2014-04-30 20:44 ` Jonathan Cameron
2014-04-30 9:26 ` [PATCH 4/5 v3] iio: exynos_adc: do a soft reset in case of timeout Naveen Krishna Chatradhi
2014-04-30 20:47 ` Jonathan Cameron
2014-04-30 9:26 ` [PATCH 5/5 v3] iio: exynos_adc: do a reinit_completion before the conversion Naveen Krishna Chatradhi
2014-04-30 20:49 ` Jonathan Cameron
2014-04-30 23:23 ` Doug Anderson
2014-05-01 5:48 ` 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=53616081.1070806@kernel.org \
--to=jic23@kernel.org \
--cc=ch.naveen@samsung.com \
--cc=cpgs@samsung.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=grundler@chromium.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=naveenkrishna.ch@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).