summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2024-02-23 13:45:23 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-02-28 19:26:37 +0000
commit9443c19ca6014e4ce6822c60b5bb9826903dff49 (patch)
tree142015fb54bfa0ab830879fcb58751b15537ff85 /drivers/iio
parent5b4e4b72034f85f7a0cdd147d3d729c5a22c8764 (diff)
downloadlinux-9443c19ca6014e4ce6822c60b5bb9826903dff49.tar.gz
linux-9443c19ca6014e4ce6822c60b5bb9826903dff49.tar.bz2
linux-9443c19ca6014e4ce6822c60b5bb9826903dff49.zip
iio: adc: rockchip_saradc: replace custom logic with devm_reset_control_get_optional_exclusive
devm_reset_control_get_optional_exclusive does what this driver is trying to do in its probe function, therefore let's switch over to that subsystem function. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240223-saradcv2-chan-mask-v1-3-84b06a0f623a@theobroma-systems.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/rockchip_saradc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 1c0042fbbb54..bbe954a738c7 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -450,16 +450,11 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
* The reset should be an optional property, as it should work
* with old devicetrees as well
*/
- info->reset = devm_reset_control_get_exclusive(&pdev->dev,
- "saradc-apb");
+ info->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
+ "saradc-apb");
if (IS_ERR(info->reset)) {
ret = PTR_ERR(info->reset);
- if (ret != -ENOENT)
- return dev_err_probe(&pdev->dev, ret,
- "failed to get saradc-apb\n");
-
- dev_dbg(&pdev->dev, "no reset control found\n");
- info->reset = NULL;
+ return dev_err_probe(&pdev->dev, ret, "failed to get saradc-apb\n");
}
init_completion(&info->completion);