Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1739859 > unrolled thread

[PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node

Started byQuentin Schulz <quentin.schulz@free-electrons.com>
First post2017-09-26 15:00 +0200
Last post2017-09-26 15:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-09-26 15:00 +0200
    Re: [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when  no thermal DT node Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-26 15:30 +0200

#1739859 — [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node

FromQuentin Schulz <quentin.schulz@free-electrons.com>
Date2017-09-26 15:00 +0200
Subject[PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node
Message-ID<utXCW-4V5-9@gated-at.bofh.it>
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>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 392d47f..46fe0b5 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -652,7 +652,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));
-- 
git-series 0.9.1

[toc] | [next] | [standalone]


#1739889 — Re: [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-09-26 15:30 +0200
SubjectRe: [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node
Message-ID<utY5Y-5jU-21@gated-at.bofh.it>
In reply to#1739859

[Multipart message — attachments visible in raw view] — view raw

On Tue, Sep 26, 2017 at 12:52:19PM +0000, Quentin Schulz wrote:
> 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>

For both patches:
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web