Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1223437lqt; Sat, 20 Apr 2024 06:07:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUUcGHeELGU6pqdXL6FnimSA9qnlmAfiDWdyYuqSX8UsHQcpduGsDEcDy7Lo0G5q3Y1Ypd0+H0V4ST9thLnCTPte6bzxChhxZLBMvfwRw== X-Google-Smtp-Source: AGHT+IGrAaODpWOdElQ4yVbMfqCNbwq7yxzKWPxEu1qlr2QVYy5OAOd3gl69oBM9Ov9xeJWWRsKy X-Received: by 2002:a17:906:d288:b0:a51:dc32:ffd0 with SMTP id ay8-20020a170906d28800b00a51dc32ffd0mr3648241ejb.63.1713618421839; Sat, 20 Apr 2024 06:07:01 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lr22-20020a170906fb9600b00a522897bfa3si3497270ejb.310.2024.04.20.06.07.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 06:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=QYK0GRP+; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-152269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 87C261F213A2 for ; Sat, 20 Apr 2024 13:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C8BC1E86C; Sat, 20 Apr 2024 13:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QYK0GRP+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7890A625; Sat, 20 Apr 2024 13:06:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713618412; cv=none; b=I4ftQ8+xB2hojlZKW6bjRBQgmEKflof/hzTmIuE+7eLMYbOId7KfGFuKAyNX474MOpUsrgvFtd+8vWSqKj+ZAeB3q7h7hNXYyH768ZJaMhv1FaGRTqGPag8kCKEmGG0Obo6Th7yVXAXhvTA0m4oNVvcRzDYPhcCbaVKVueoGtuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713618412; c=relaxed/simple; bh=N4vN3xcboLIjcxz6Bmykno3uW1Git1Vd/uH85dY0LS4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KhZRo4qIKXAZbo+hFdGUpig+LvKJh8BMmCp3qwGleuvjgPKbd5540vSpp3Vb+p2/9lG0oJZGFHptpvfRJf5R09ZoAh4fI/mkvjKf+YSpPx9P5LahHK6jkOcV9F2rNpZ21jN1yAUzK8q+xH79MuaT+1xpmdQMlkCPtQtw7+iIe4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QYK0GRP+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11066C072AA; Sat, 20 Apr 2024 13:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713618412; bh=N4vN3xcboLIjcxz6Bmykno3uW1Git1Vd/uH85dY0LS4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QYK0GRP+m4Cct/mfSzhcXZFYfRmR4F4A+nQncYRYOW4DLMxbJD1BE6SRBD5xV3Ofe 2AjUjcCbiirX6iZYY4zEy4l2OUgWpnIsAUJlcPCpiHGaKycKG8VBDlILk9ayDo9A6A KDZWM8ASfUMcg0JPPReGhFT20Gsv2bjRw0Y2FAQbWO4ZAWuxirTDbncjL4DkBDEFDk IdLMFknMJUF1YYTiqY1nxHbmhbGEgFW5SzrbAenic1DgQizC4uHO+BO52ZIYKakqvD 0rQeDLmpxu9cMQ5mF/SipssCiD86PA9pQBwYyAIabut3WzfHLti89sxmhG5GLM73FD AXo64nLedJ//A== Date: Sat, 20 Apr 2024 14:06:35 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Aren Moynihan , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , Ondrej Jirman , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , 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: Re: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails Message-ID: <20240420140635.6dffa2fb@jic23-huawei> In-Reply-To: References: <20240414175300.956243-1-aren@peacevolution.org> <20240414175716.958831-1-aren@peacevolution.org> <20240414175716.958831-3-aren@peacevolution.org> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 15 Apr 2024 18:05:54 +0300 Andy Shevchenko wrote: > On Sun, Apr 14, 2024 at 8:57=E2=80=AFPM Aren Moynihan wrote: > > > > 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). =20 >=20 > > ret =3D regmap_read(data->regmap, STK3310_REG_ID, &chipid); > > - if (ret < 0) > > + if (ret < 0) { > > + dev_err(&client->dev, "failed to read chip id: %d", ret= ); > > return ret; > > + } =20 >=20 > Briefly looking at the code it seems that this one is strictly part of > the probe phase, which means we may use >=20 > return dev_err_probe(...); >=20 > pattern. Yet, you may add another patch to clean up all of them: > _probe(), _init(), _regmap_init() to use the same pattern everywhere. >=20 Yes, a precursor patch to use dev_err_probe() throughout the probe only functions in this driver would be excellent. Jonathan