Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp81776lqd; Tue, 23 Apr 2024 15:42:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6dFPBQXEy0HHUDGM+CfdlZgPcWz26rJizA1U+Cw2V/bV7gDEi9UBErjLa8S9vSVHZF+EhaqxQfZAeLGjepupZtrm3iK9laDvKe9yqUA== X-Google-Smtp-Source: AGHT+IFX7KBdKH9ZgUnUzLh7A9XDq2/eWHO08+s2Rb1Wi2RYNjvif/Vx3+2BKk6veM98ckjJw23w X-Received: by 2002:a05:6a00:1786:b0:6ed:416d:f86 with SMTP id s6-20020a056a00178600b006ed416d0f86mr1217998pfg.15.1713912119935; Tue, 23 Apr 2024 15:41:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713912119; cv=pass; d=google.com; s=arc-20160816; b=BWvnXQXED22YeqK5WM/oUqec/Oho94ltTLWLTI3r7DVcm38IgZGf6CXbNLcSRD8//Y CRKIJ5RuktVDcKQh/ME+KTJNh/E/ISDskdJwu7ZlRlEsreweVngyhjkcQIhE8OkEeesN RIm8VNuiUQ/XATZo/KpM3MyWojpU5VXeCtUN67yka/VSeE7K+6vaHhAYShW1PQQnmQf1 AorU/6UI5kJGPxevfdKxXjnWi/+raygkaHLXrfp7Tnq+HG5qmiDVsq8wl/OoUCwbD3kW VSxZ4mhZYDneeYjYcrh2THuvtYLGfl+U9Dd5HmETw3EmRyMC9xgggtVIssEwPgdWcUwY lkmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=UWXpr+mFtuZWn0I9z7i9pNE5fb1S4ZmF1FsSOEaCDY8=; fh=tE5n859cV0BjUJONcvWuvDBTrbwjawIl47goqTT+08o=; b=CL3TyrnW+6mgvwl0GEs1N5BmeVkmhqwx6cx8sHvMdFCbYgIhvF1BjJEs14JeXvp/Kn YtQ2oSAj5nhuibBlOOv3qs6LZWab3uAE+0O/1H6vLeEYlMZVIfM2TQr9ikX3nSyS74zr +TKsmcetbZ8FxlwbeAfuJOwpPxUxBz8Im1bj8hY0OyVGHCKhNaWE7zJQGhjURFdsg6cp xY2WL1p6RutUwZCq04ipR8jLkQXVxlpRDItHy2+89b3b0Ul+iB8Zme6sbkTOIw8bL4sE m6xAoXLsuLoC/GCItPhdJVC08kVreVBIazlks4S2qIZ2ti3vLBuUb4KreyWNwyg2vZvH PmxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=ABT0QfHC; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-155965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u29-20020a63471d000000b005f0a511e5edsi10482240pga.58.2024.04.23.15.41.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 15:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=ABT0QfHC; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-155965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1B8AF28A1AA for ; Tue, 23 Apr 2024 22:41:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF972535B6; Tue, 23 Apr 2024 22:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b="ABT0QfHC" Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A994D2E859; Tue, 23 Apr 2024 22:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.193.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713912080; cv=none; b=iP1wR/XMEhUSjo56ZQCFKZGc+ADDh7Eg/mg9i+IbVMHpFp2XPrvPiMWARYeE3EtrlXsaUAOYWvM8ccO/00cHXJnjp0g67RMV5NkeRuVWE4t6Lyrc56Dnjgts3Menvr4QZUPuSKFf9nWgelLdqmhgTyfGQ78dJIUS/Bdp9O2eiqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713912080; c=relaxed/simple; bh=9N73cNhfVQaoSJ0DN5ep872w+52N5ZGu7OsFMCg9whc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I9q6sfe41cKqAzRC/tgObFGoMiDAMv2gOa6GaLcNhaqLu1HK8HK0Edp1uTAs8sp6hPNFUgwy1kr0v+WVfxhfPr2WCc8rSX+O21yOzG65oGk7UMHnIxJks3lFbx7WEVmvmv+6JVeaYy95Mnz3yXjzfxauMHQfoCyfYtBV0DVcfyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org; spf=pass smtp.mailfrom=peacevolution.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b=ABT0QfHC; arc=none smtp.client-ip=206.189.193.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peacevolution.org Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 045F847A5D; Tue, 23 Apr 2024 22:41:14 +0000 (UTC) From: Aren Moynihan To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown Cc: Aren Moynihan , Andy Shevchenko , Ondrej Jirman , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-iio@vger.kernel.org, phone-devel@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Willow Barraco Subject: [PATCH v2 5/6] iio: light: stk3310: log error if reading the chip id fails Date: Tue, 23 Apr 2024 18:33:08 -0400 Message-ID: <20240423223309.1468198-7-aren@peacevolution.org> In-Reply-To: <20240423223309.1468198-2-aren@peacevolution.org> References: <20240423223309.1468198-2-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org X-Spam-Level: ** X-Spamd-Bar: ++ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1713912076; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding:in-reply-to:references; bh=UWXpr+mFtuZWn0I9z7i9pNE5fb1S4ZmF1FsSOEaCDY8=; b=ABT0QfHCstWYlhb5huxIJr/n4qDSVSFsxksisDcoy3ke6S+gPj0FLQ37n2R9UXskuwaobf y6Nk9MNPJNNQr8PC1RVGVYnxF5Wb1UCfumq6VIxnyBxM2yJ7+VMnjFW0nXYR4ooduh1sVD 6ImTZmNEn0X9UhpNjNfl71M4isz1flk= If the chip isn't powered, this call is likely to return an error. Without a log here the driver will silently fail to probe. Common errors are ENXIO (when the chip isn't powered) and ETIMEDOUT (when the i2c bus isn't powered). Signed-off-by: Aren Moynihan --- Notes: Changes in v2: - use dev_err_probe drivers/iio/light/stk3310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index c56c6298d292..6ee6f145a6d5 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -475,7 +475,7 @@ static int stk3310_init(struct iio_dev *indio_dev) ret = regmap_read(data->regmap, STK3310_REG_ID, &chipid); if (ret < 0) - return ret; + return dev_err_probe(&client->dev, ret, "failed to read chip id\n"); if (chipid != STK3310_CHIP_ID_VAL && chipid != STK3311_CHIP_ID_VAL && -- 2.44.0