From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13E3D3101DC for ; Wed, 28 Jan 2026 17:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769622146; cv=none; b=lRL86Gpb9x5BsytdMw6SIRPTWT54OjGfRAtWGBq/Vylt0ZdgzKDuuXmWzwRoTdmQI1ju5lCDksvquiOWvG7/j1ml+QM96vCv6RzvcjRjtCB7pudm1l19tqq6FqYIUob3xQvJQBwjClVYiOG44oPFc9y3BssGbL/8b+EVMWa21Fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769622146; c=relaxed/simple; bh=4U9N2OVid/0eWGBgBLU4CBzBMpZQet8P/NP52u6Ikbc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KCeqkV56efsU74ou8Glz8k6ZGd1KPUbRj9Fb3uEJOwTm7GbvWu4JgVDxq41scQKiqrrtwd5fz+DjjhLCCbpr/eMoTreUBbbviw4HolYQJn8dFvLzKjUSPyn8onjrPsV+Fw42FWHVWGiVmp07GeWUrpDMeG8nWO4F1BKHU/k/Az8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cLonJfKD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cLonJfKD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DA0EC4CEF7; Wed, 28 Jan 2026 17:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769622145; bh=4U9N2OVid/0eWGBgBLU4CBzBMpZQet8P/NP52u6Ikbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cLonJfKDIArEY+YoV0sNaNSEdYaOnnkxf6bUVeKzIe5VSNdyns+1sw1Mo+QiBDulT WjDPNSvvMxJjLgsRlbApckaxRXqjaaNgyAn0lQxsrp5lWFHXQDuN3CaFHYRm3m4Ull 9LwZbiuk2wo08IwITSGEdsfHw48aWd8zvtH6eM0oHDtGWmRJqNXPNnuA2PtHe4CI9b 9qqQIDS9ePBUcz43v4D4yC3lLdtfZNyvrGScfKRqUM4wld0WPbMm+zsA4TFNl62MCq gi3sKegxBCvlw6SO8xptezySfHgXlVml7C+lPP6yF3PwRY28ESs08YYMQlICibolL5 GztOTOYxl+vpw== From: Sasha Levin To: stable@vger.kernel.org Cc: Johan Hovold , Krzysztof Kozlowski , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.10.y] iio: adc: exynos_adc: fix OF populate on driver rebind Date: Wed, 28 Jan 2026 12:42:23 -0500 Message-ID: <20260128174223.2597131-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026012754-snuggle-nursing-d9b7@gregkh> References: <2026012754-snuggle-nursing-d9b7@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johan Hovold [ Upstream commit ea6b4feba85e996e840e0b661bc42793df6eb701 ] Since commit c6e126de43e7 ("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: c6e126de43e7 ("of: Keep track of populated platform devices") Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Johan Hovold Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jonathan Cameron [ Adjust context ] Signed-off-by: Sasha Levin --- drivers/iio/adc/exynos_adc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index b6f09e5acb91d..1a71d144059e0 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -718,14 +718,7 @@ static const struct iio_chan_spec exynos_adc_iio_channels[] = { ADC_CHANNEL(9, "adc9"), }; -static int exynos_adc_remove_devices(struct device *dev, void *c) -{ - struct platform_device *pdev = to_platform_device(dev); - - platform_device_unregister(pdev); - return 0; -} static int exynos_adc_ts_open(struct input_dev *dev) { @@ -924,8 +917,7 @@ static int exynos_adc_probe(struct platform_device *pdev) return 0; err_of_populate: - device_for_each_child(&indio_dev->dev, NULL, - exynos_adc_remove_devices); + of_platform_depopulate(&indio_dev->dev); if (has_ts) { input_unregister_device(info->input); free_irq(info->tsirq, info); @@ -954,8 +946,7 @@ static int exynos_adc_remove(struct platform_device *pdev) free_irq(info->tsirq, info); input_unregister_device(info->input); } - device_for_each_child(&indio_dev->dev, NULL, - exynos_adc_remove_devices); + of_platform_depopulate(&indio_dev->dev); iio_device_unregister(indio_dev); free_irq(info->irq, info); if (info->data->exit_hw) -- 2.51.0