From patchwork Tue Sep 26 12:52:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 9971955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7201A603F2 for ; Tue, 26 Sep 2017 12:53:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6800328A65 for ; Tue, 26 Sep 2017 12:53:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C93928AC0; Tue, 26 Sep 2017 12:53:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96CBA28D2A for ; Tue, 26 Sep 2017 12:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gqe8FN5k65vzrriFSSNYFEEK50KxG82NDgOANFmoqUo=; b=sbiHwWG/kkFRGYW5eqjnGEZLXQ MbmNSBgJtZKu5UezFuXXslgjbm/wuuyi7LWP4YW1ERQs7907d2rsHQ9KGmFiboeV1p4v4Eas167jb nww6jgoU0XWreh2/uBS4iV9w2XKWaJJrNnmhu1tc8XvfHXR21KpgKKwKhxXgCwitrECzFuwux+DRk aDmcb1ncf2xtwhAaCwmV6Dq5cHBBSHTEso4nsTQbIRdz4ECiv28pQaLSTmVjdqCwsd08lP3gTM+cq Puuab6eIraAnoxEhH8T8cVQlMA/2TpFEAjqVKRiheL6ElQEit+NzYdmoN7AU1c3AZ0UVeyXOz7Cm3 wk2zijsg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dwpML-0000OL-Io; Tue, 26 Sep 2017 12:53:09 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dwpMH-0008QJ-9J for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2017 12:53:07 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id D8D50208EB; Tue, 26 Sep 2017 14:52:43 +0200 (CEST) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 86194208D0; Tue, 26 Sep 2017 14:52:33 +0200 (CEST) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH 2/2] iio: adc: sun4i-gpadc-iio: do not fail probing when no thermal DT node Date: Tue, 26 Sep 2017 14:52:19 +0200 Message-Id: <160cf183a167ef841c96c5626f42e23b7195effa.1506430136.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170926_055305_478085_1037EEE0 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, icenowy@aosc.io MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Maxime Ripard --- 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));