From patchwork Tue Sep 10 07:59:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 11138889 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5D3E13BD for ; Tue, 10 Sep 2019 07:59:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 926D4216F4 for ; Tue, 10 Sep 2019 07:59:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="F/4DbNZM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729267AbfIJH7N (ORCPT ); Tue, 10 Sep 2019 03:59:13 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42898 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727205AbfIJH7N (ORCPT ); Tue, 10 Sep 2019 03:59:13 -0400 Received: by mail-pg1-f194.google.com with SMTP id p3so9364350pgb.9 for ; Tue, 10 Sep 2019 00:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+ICqDZT0+Rww/hGCZQ9/7SaJeWoOs3iDbAih166xoms=; b=F/4DbNZMB0nf7DgnHlLG8hechqYzxn49BWwlDiqD6w5zAWKLdtCcwUMdYD1CsqN+Ng jzKPub20pUMRPuzTI4YvJD3AiyE28CCh4t/qGp+gjJYenrY9lh/BXg7sRph0NR66KjSF k6CBYACYO5XANiHDoc9soi/2ks1/EbDYV2mfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+ICqDZT0+Rww/hGCZQ9/7SaJeWoOs3iDbAih166xoms=; b=hoVxLVhZ9KbBYJie6UKIYoaFR7hD27jd0cXcOCun/VuEKDawGxBrw0wXvLSTJDroTi /zM40muqbEtKCZBB/0wcTUm/MFoaET7AB1chFx/iN0KnFbyBp2G9Rbc57c6T5UZmAgPR 6ux9/fEWVVoxKeWBcmZ8t3O3VVgTV9Dqwy/jx0n0eszyl6AZFgapCY+eO7x/9NvbkNcx sH5VfbSBhTbaOwO7mtKg7EUGBGPMMq/k0fEG52i6GJrH17ohxaamBWXYgnX/5E5xQ2Z/ Tfo0shxVsLOpTg84choaD8HToo9f+WoKW6gRoZ0RLPIXX5xEsIzxfN1BJ+4JzPrOdFF5 Slbg== X-Gm-Message-State: APjAAAWhsernEP8Gmdhxkx6N8jLNttVT1+ut5xNubqqBDWHYURouu2sf EzscNwb8vSX4do88ydqg8OnRxQ== X-Google-Smtp-Source: APXvYqyDn9hO++8SUhAPekxT/ojMiADYLdC41QbV41Z++f9OMrsB5LXCadAWjtEN/hNbyMZ7r2vYLg== X-Received: by 2002:aa7:870c:: with SMTP id b12mr34260902pfo.122.1568102352293; Tue, 10 Sep 2019 00:59:12 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id c23sm16189538pgj.62.2019.09.10.00.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 00:59:11 -0700 (PDT) From: Hsin-Yi Wang To: Eduardo Valentin , Laxman Dewangan , linux-arm-kernel@lists.infradead.org Cc: Zhang Rui , Daniel Lezcano , Jonathan Cameron , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal-generic-adc: Silent error message for EPROBE_DEFER Date: Tue, 10 Sep 2019 15:59:07 +0800 Message-Id: <20190910075907.132200-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.23.0.162.g0b9fbb3734-goog MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org If devm_iio_channel_get() or devm_thermal_zone_of_sensor_register() fail with EPROBE_DEFER, we shouldn't print an error message, as the device will be probed again later. Signed-off-by: Hsin-Yi Wang Acked-by: Jonathan Cameron --- drivers/thermal/thermal-generic-adc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index dcecf2e8dc8e..ae5743c9a894 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -134,7 +134,8 @@ static int gadc_thermal_probe(struct platform_device *pdev) gti->channel = devm_iio_channel_get(&pdev->dev, "sensor-channel"); if (IS_ERR(gti->channel)) { ret = PTR_ERR(gti->channel); - dev_err(&pdev->dev, "IIO channel not found: %d\n", ret); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "IIO channel not found: %d\n", ret); return ret; } @@ -142,8 +143,10 @@ static int gadc_thermal_probe(struct platform_device *pdev) &gadc_thermal_ops); if (IS_ERR(gti->tz_dev)) { ret = PTR_ERR(gti->tz_dev); - dev_err(&pdev->dev, "Thermal zone sensor register failed: %d\n", - ret); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "Thermal zone sensor register failed: %d\n", + ret); return ret; }