Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1309237lqs; Sat, 15 Jun 2024 03:41:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMaofc7DhihbNgLm8qjCWsTyHUKvImaAMuEZ8vMCJQXx6R6xFA2grUM2ztxJb8dWuBMoNZhrU3+0gxYIqbUU8/ea35gi/wdbWl0+g2kg== X-Google-Smtp-Source: AGHT+IED6Fqdu1Jm0+lM2crUO3lG6L8jtvSyQkWXy3n9tb/cMVTwZGaB2YFaYwtOGvHxtH+j911F X-Received: by 2002:a50:d5cd:0:b0:57c:a49f:ddd4 with SMTP id 4fb4d7f45d1cf-57cbd6879f3mr2921370a12.17.1718448073100; Sat, 15 Jun 2024 03:41:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718448073; cv=pass; d=google.com; s=arc-20160816; b=B9YQk+3Ri9WfGOfy3AJQqk2kNfBNjp0hEJFFUNwzm7A6zuZY+lk0+l/UcMOv/7P3qJ OsEOSb3d3QDlh/MTtA2mGkU1gaEltbi5xEnTmW0vMLAtKuqS0obXahRWkloGD7oII+jn f8Be2AczpyBx5AfGlJymmiwP7f4qO4ss5+P/jQe3EGJtuXGIpuTpAaVFW70tIsZthjsX 6wMIVAq2z+0JZl32RuA4Tn+7LC56Wre8lF6HvoIzrpm2bGar4HT+Ieh/CODSQYjAcORO JtExeISNZ/2U+RftTt8YAfytfbXd07SpZzWmIjiJKWiIYW6sRYCI7TFmK68bJXHnqynA NJvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=9fUx1M/ChwVMffEn+YTli8Q4srJmxp8UyiHvk1KaG0Q=; fh=mzR01S8Egv8Zc148LPNjTE/2+emkM6vNrpnAGsfL5k0=; b=KilFxJWT+rAfeWumJdzYbjFSaZMaC3HASLoE6OB/s3ohSjSCRik5pGFIIT/j62Vimp qld+V5BucEgJeP3kgyWb7y9zzLzTs3QxTN7tW0vkOedkt14GXLYx2jXIyhT+haiXis65 ZyQLPt+Bmpu6rcr/Uodz6HuMtfW52X7Yh1PH9/yuBaCbTXYfOf/FDEDLxQhrtn7aWgCl 2A7r9z3s988zY/JXrxL56zCqMRjh0KsBuQVp9CeNsEDafLyaaZxwU/Gxent8/5OMRCVT 73HpPOsfcT4Hbnmlrnz6mCIYynApcWI+PfgKMGoZ68wdow/mqPzggkkPRSFqNiRC9EZk +LsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hbaUoTea; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215836-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb7e9ee7fsi2683308a12.134.2024.06.15.03.41.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 03:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215836-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hbaUoTea; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215836-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215836-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 CFD1D1F21FFA for ; Sat, 15 Jun 2024 10:41:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE19A38384; Sat, 15 Jun 2024 10:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hbaUoTea" 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 C713D3A8D2; Sat, 15 Jun 2024 10:40:57 +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=1718448057; cv=none; b=REwBjMzAroqZSD+9XmeMhOuu5VUm5EGp1O1F2msqSE6j4erVUcwj8xAhX0WpDg8GCkp1axaGnwngGmxPdcNziKu3YJnepSL1QVlnQ5JzCg1Jsv/x1+/PDNlDCx3J2qqAIkjqkzN0PswxrTbFZLhNdGOSxAxr2FAV7WG9x04FPeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718448057; c=relaxed/simple; bh=5/hYyJIIEoZXTpXMYw2yQWyZ2erfhzbU4WNhDN09KFs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KKDjKcSWQjIRJyifQNruQnLfbsKHbwllMAOTzWkRM7foPE3ObhQmM+HqRFCLx09gb1LuN5mdmEt4qS1xSuTY58IoLruu4MKvfZfYrBusHjr5SDf9xPx3FjPUMseKVvdfdExml3pCqUpcrj6au7iKysw+vZJiA8yu11WAwhgO4z4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hbaUoTea; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C61C116B1; Sat, 15 Jun 2024 10:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718448057; bh=5/hYyJIIEoZXTpXMYw2yQWyZ2erfhzbU4WNhDN09KFs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hbaUoTeajKyPRJhHUWwdL01CrSb9aL4oZ+w7KoHSQNiqkT8FaJpvRdxLlhdLnmd52 jQl38J5YLPJos+vd8qTq/mrl6+pK6i7a6A13ToDdrseOiZ7s9sLddbGmtcCFjz5tqw 5IGF93OuZk/Y101GWwwjBukafhs3nghzcJ8DGA1OLMJEjjbpuuuODCmSybDeSzPGgm Lrwsf23rQC5Qwt570mrMz+pxpe+KwDi/KRX/kMpcbqWxmMtX6I1bDqNopSyizGA1zZ 0m7lLg2qp+a9fHLlTiqddrozH1mRByHCHZNTB9kGPncnIeGW7JVJodnv8+u3UaXhsk 4Bt5d1hP1QU0Q== Date: Sat, 15 Jun 2024 11:40:50 +0100 From: Jonathan Cameron To: Trevor Gamblin Cc: Nuno =?UTF-8?B?U8Oh?= , Lars-Peter Clausen , Michael Hennerich , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: adi-axi-adc: improve probe() error messaging Message-ID: <20240615114050.46d2b0a7@jic23-huawei> In-Reply-To: <964821b3-dcbb-42b8-9062-2366a4d30a76@baylibre.com> References: <20240613163407.2147884-1-tgamblin@baylibre.com> <57d4659a5abb63d7c085865059b9d71c40371edd.camel@gmail.com> <964821b3-dcbb-42b8-9062-2366a4d30a76@baylibre.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; 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 Fri, 14 Jun 2024 15:18:12 -0400 Trevor Gamblin wrote: > On 2024-06-14 5:11 a.m., Nuno S=C3=A1 wrote: > > On Thu, 2024-06-13 at 12:34 -0400, Trevor Gamblin wrote: =20 > >> The current error handling for calls such as devm_clk_get_enabled() in > >> the adi-axi-adc probe() function means that, if a property such as > >> 'clocks' (for example) is not present in the devicetree when booting a > >> kernel with the driver enabled, the resulting error message will be > >> vague, e.g.: > >> =20 > >>> adi_axi_adc 44a00000.backend: probe with driver adi_axi_adc failed wi= th error -2 =20 > >> Change the devm_clk_get_enabled(), devm_regmap_init_mmio(), and > >> devm_iio_backend_register() checks to use dev_err_probe() with some > >> context for easier debugging. > >> > >> After the fix: > >> =20 > >>> adi_axi_adc 44a00000.backend: error -ENOENT: failed to get clock > >>> adi_axi_adc 44a00000.backend: probe with driver adi_axi_adc failed wi= th error -2 =20 > >> Signed-off-by: Trevor Gamblin > >> --- =20 > > Somehow feel that in these cases the error log should come from the fun= ctions we're > > calling but bah... likely not going happen/change: > > > > Reviewed-by: Nuno Sa > > > > (As a suggestion, you may do similar work in the axi-dac driver) =20 >=20 > Thanks. I'll send that early next week after a quick test on a board. I tweaked the commit text to say After the change: as I don't want to see this picked up by a bot for stable. As a side note, you could have taken the opportunity to add struct device *dev =3D pdev->dev; which I think would have reduced a few line lengths without loosing readability. Not important though and perhaps not even a good idea :) Applied to the togreg branch of iio.git and pushed out as testing. Note I plan to rebase my tree shortly to avoid some merge conflicts that otherwise occur. I'll probably do that before I push out other than as testing. Thanks, Jonathan >=20 > Trevor >=20 > > > > - Nuno S=C3=A1 > > > > =20 >=20