summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/sun4i-gpadc-iio.c
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@free-electrons.com>2017-09-26 14:52:19 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-10-09 21:49:47 +0200
commit3b455cdc49e8d91e84184e60e01a390c7eb23134 (patch)
treec9ccc039082d86e08ba305d03d3fa2f5341d8a2d /drivers/iio/adc/sun4i-gpadc-iio.c
parentiio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm (diff)
downloadlinux-3b455cdc49e8d91e84184e60e01a390c7eb23134.tar.xz
linux-3b455cdc49e8d91e84184e60e01a390c7eb23134.zip
iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node
Before this patch, forgetting to put a thermal-zones DT node would result in the driver failing to probe. It should be perfectly acceptable to have the driver probe even if no thermal-zones DT is found. However, it shouldn't want to fail if the thermal registering fail for any other reason (waiting for other drivers for example) so check on ENODEV only. Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/sun4i-gpadc-iio.c')
-rw-r--r--drivers/iio/adc/sun4i-gpadc-iio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 430b06ceb625..c4e70f1cad79 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -651,7 +651,11 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
info->tzd = thermal_zone_of_sensor_register(info->sensor_device,
0, info,
&sun4i_ts_tz_ops);
- if (IS_ERR(info->tzd)) {
+ /*
+ * Do not fail driver probing when failing to register in
+ * thermal because no thermal DT node is found.
+ */
+ if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
dev_err(&pdev->dev,
"could not register thermal sensor: %ld\n",
PTR_ERR(info->tzd));