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: 114262 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3794104qgf; Tue, 26 Sep 2017 05:52:52 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDh4LVgJ6FGMSqRMj+try2N6iGBrAH4Z2K25Lj7yvL7qo6cVFlda2Jvc2dFvpue848l5Lkt X-Received: by 10.98.163.153 with SMTP id q25mr10614841pfl.183.1506430372825; Tue, 26 Sep 2017 05:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506430372; cv=none; d=google.com; s=arc-20160816; b=om5EFl9bZAn3HllZe//dUkiSvOb+H3alh29ZGCr20aBQfzUf2WJzmds/XffwaGdsP1 s2xK5SXRK4t7SJCZw2Md4sI3CZ5lImDyGOLeaNwNtTuD4SSY/42C1XJ18xlkfmwnt84t OKSCJxkokAdt5MfyXLhADmY2Gin1dxC8DVsdg6vyViIAQrAI6ng8d7xBvc2xoNz/aq0E 3GcZ2oe66xf5zvYzpkeXTasXJC0rJXJH/zKepJljY8c84AKi2GxGaskZTRBXqFY5nL+N EhFXi5QkGSAY1BwpZVeS7UU76gOvSrUU6rLYgxy1Cvjj1VilT5d+MXeD19m5hv7rPHOW Zkhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2SYNdJEyXHOclWt9t0E3rsInIPtijom7pkyHM5IT9ns=; b=nInl/DCJYtSYYPaOsDvRiPzYJp+blwLQHJKIfkRlS0kCaFs9S2JoADV2tm1CeMLTiB AjDBVyIXEh4cvJyd36lCyyk383ueuqnxahh9wwYH2XkE7tuyCz7dyUTh7AYUsQlczCC8 dz+bqNFADbW1SIvAu8aZZdqIpt+Ewx5LbgS0Cb0weSHxD3tbZgag0EpWmt5gI3WurzVb ZDKdb4qLOLuuOJ3V8nceCK2ZZo6gr/CDyZOujLzJBVhLLzglKYjRajQe5pubO+ILEvCp hiEkP9VXMBzyyKYuYQnYEqtaXG1U9QCHJbpKqoTc779sebwi+htqvY1LS2hOwPwoq23z BMfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s185si5816853pgb.399.2017.09.26.05.52.52; Tue, 26 Sep 2017 05:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968874AbdIZMwt (ORCPT + 26 others); Tue, 26 Sep 2017 08:52:49 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:53557 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968843AbdIZMwp (ORCPT ); Tue, 26 Sep 2017 08:52:45 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id D8D50208EB; Tue, 26 Sep 2017 14:52:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 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 Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, thomas.petazzoni@free-electrons.com, icenowy@aosc.io, Quentin Schulz 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/iio/adc/sun4i-gpadc-iio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- git-series 0.9.1 Acked-by: Maxime Ripard 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));