Skip to content

Commit 437a871

Browse files
jhovoldgregkh
authored andcommitted
iio: adc: exynos_adc: fix OF populate on driver rebind
[ Upstream commit ea6b4fe ] Since commit c6e126d ("of: Keep track of populated platform devices") child devices will not be created by of_platform_populate() if the devices had previously been deregistered individually so that the OF_POPULATED flag is still set in the corresponding OF nodes. Switch to using of_platform_depopulate() instead of open coding so that the child devices are created if the driver is rebound. Fixes: c6e126d ("of: Keep track of populated platform devices") Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> [ Adjust context ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 629be44 commit 437a871

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

drivers/iio/adc/exynos_adc.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -721,14 +721,7 @@ static const struct iio_chan_spec exynos_adc_iio_channels[] = {
721721
ADC_CHANNEL(9, "adc9"),
722722
};
723723

724-
static int exynos_adc_remove_devices(struct device *dev, void *c)
725-
{
726-
struct platform_device *pdev = to_platform_device(dev);
727-
728-
platform_device_unregister(pdev);
729724

730-
return 0;
731-
}
732725

733726
static int exynos_adc_ts_open(struct input_dev *dev)
734727
{
@@ -929,8 +922,7 @@ static int exynos_adc_probe(struct platform_device *pdev)
929922
return 0;
930923

931924
err_of_populate:
932-
device_for_each_child(&indio_dev->dev, NULL,
933-
exynos_adc_remove_devices);
925+
of_platform_depopulate(&indio_dev->dev);
934926
if (has_ts) {
935927
input_unregister_device(info->input);
936928
free_irq(info->tsirq, info);
@@ -959,8 +951,7 @@ static void exynos_adc_remove(struct platform_device *pdev)
959951
free_irq(info->tsirq, info);
960952
input_unregister_device(info->input);
961953
}
962-
device_for_each_child(&indio_dev->dev, NULL,
963-
exynos_adc_remove_devices);
954+
of_platform_depopulate(&indio_dev->dev);
964955
iio_device_unregister(indio_dev);
965956
free_irq(info->irq, info);
966957
if (info->data->exit_hw)

0 commit comments

Comments
 (0)