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 70B0329992B for ; Tue, 27 Jan 2026 21:07:07 +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=1769548027; cv=none; b=XjzTjVxj3BLAvu5qBq6gHdWls7kS4cef2paIPXTEzYFmYRDLF+jbuegWL328TXAMCRSi37yYU2H3TuaG41Skb/OW7vhSFhTldL7s6PLblEnjJYS4uNXtxkEE/lAhvSMAgrcgpDAmEIFUwv0M1UCh5zSTQZz9PyXhTIJIJ1NJfek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769548027; c=relaxed/simple; bh=iq05q6PDgmeGKZG+ZCZf4NVQ7qWHvgTbCPwJ9B3qJ/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Um2/4u+6UB7RSzr3rdtY8tDneCuxNuztZ9/T8RWyxWnm/YEeDqCruDnnBF4FF7Djg+UKu++NeLfABXybyK9pSoCJ/3+GJbsywawLWciJngtcwOHi8MoR8bNOYaN92ucyPh6Wh56qsDx8DTSNwO8Hm7r4/jAw6uIdT0tf3MB2mSI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SLjp1/Az; 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="SLjp1/Az" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81C81C116C6; Tue, 27 Jan 2026 21:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769548027; bh=iq05q6PDgmeGKZG+ZCZf4NVQ7qWHvgTbCPwJ9B3qJ/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLjp1/AzK23/zBOjaXkD5alJXKdZM8qvlF9q49WHUL3Gnwg4rRfA4hGl6EJpZIJI8 Yso3YxltTPiu7dPF9FaV26qNzauOBAuJEmpv84SBJ7yCdBzICihoKvy9WoK5scT+s2 wq0vsso+21+GugtP33rVqkT0bY9SgQsXleU9YEbsqxATlOJ5zO2Kw0ZHiz3O8nqSqE R4fGEG4TPVmOzMoX/mYLeCFEwCy2WdJYYXrR/eZi3wlYkRdUX9004Ka8BzOyfKYgZH sVbUUS1q+Tm96lAw8FfUuK2wDuD1L+7LyN4MA6Mjh25NifuAYsZgapHtsN1nvZXwYG 6nBfVVoJSFxWQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Johan Hovold , Krzysztof Kozlowski , Jonathan Cameron , Sasha Levin Subject: [PATCH 6.1.y] iio: adc: exynos_adc: fix OF populate on driver rebind Date: Tue, 27 Jan 2026 16:07:04 -0500 Message-ID: <20260127210704.2163667-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026012753-hangnail-upwind-6078@gregkh> References: <2026012753-hangnail-upwind-6078@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 43c8af41b4a9d..a935ef1840a6f 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -721,14 +721,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) { @@ -929,8 +922,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); @@ -959,8 +951,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