From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 3FF39319873 for ; Fri, 19 Dec 2025 18:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766169846; cv=none; b=oqk3sykrzTzGbrb3UI/tfsE65wFOsoWZli8L+UdsCsI/xUR9aPfX78TzvEnbw7zjcU87ZWSFOId4WWSck/heJ8uVEY/LNfKA8W9pjKf1QeQyXzF07H9jDa4j9H4aqsYFpY4aiZTXU4081kZ4PVQfSth3+9Aj4qk/MEpduJgxqD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766169846; c=relaxed/simple; bh=PZvQSk/l6JaNRyIauG6d+pnuxVrYrOqR9+gggBTQjdU=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QtZEvHvyGHSqYlfU0M9SZBTF5kcfx9tbm2QhdCXj4lIdyy3L1ZrPFDyDfE8KyglllPiY3ULDkTUMv9b0t3pHQCf8kHVTc4AHeWJAwO2BKjLNEsIcw+ZOBAFxhpdnB1JNSCt2rhrlIDQBNkHhzOdZSszEnjznANp5zsmXm821rbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.224.107]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4dXxJ34hd5zHnGd6; Sat, 20 Dec 2025 02:43:31 +0800 (CST) Received: from dubpeml100005.china.huawei.com (unknown [7.214.146.113]) by mail.maildlp.com (Postfix) with ESMTPS id 477C940570; Sat, 20 Dec 2025 02:44:01 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml100005.china.huawei.com (7.214.146.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Fri, 19 Dec 2025 18:43:57 +0000 Date: Fri, 19 Dec 2025 18:43:56 +0000 From: Jonathan Cameron To: Nuno =?ISO-8859-1?Q?S=E1?= CC: Nuno =?ISO-8859-1?Q?S=E1?= via B4 Relay , , , Michael Hennerich , Jonathan Cameron , "David Lechner" , Andy Shevchenko Subject: Re: [PATCH v2] iio: dac: adi-axi-dac: Make use of dev_err_probe() Message-ID: <20251219184356.000077d4@huawei.com> In-Reply-To: References: <20251219-iio-axi-dac-minor-changes-v2-1-e9fccc019b01@analog.com> <20251219162129.00006aa9@huawei.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: lhrpeml500012.china.huawei.com (7.191.174.4) To dubpeml100005.china.huawei.com (7.214.146.113) On Fri, 19 Dec 2025 17:46:52 +0000 Nuno S=E1 wrote: > On Fri, 2025-12-19 at 16:21 +0000, Jonathan Cameron wrote: > > On Fri, 19 Dec 2025 15:54:29 +0000 > > Nuno S=E1 via B4 Relay wrote: > > =20 > > > From: Nuno S=E1 > > >=20 > > > Be consistent and use dev_err_probe() as in all other places in the > > > .probe() path. > > >=20 > > > While at it, remove the line break in the version condition. Yes, it > > > goes over the 80 column limit but I do think the line break hurts > > > readability in this case. And use a struct device *dev helper for > > > neater code. > > >=20 > > > Signed-off-by: Nuno S=E1 =20 > >=20 > > This has turned into a bit of an X and Y and Z patch.=A0 In theory > > should be split up but I guess it's not too bad. =20 >=20 > Yeah, I kind of felt a bit like that when looking at the patch diff. > >=20 > > However I'm not sure why you fixed one indent and left a bunch of simil= ar > > cases looking worse? > >=20 > > Jonathan > > =20 > > > --- > > > Ended up dropping the dev_info() -> dev_dbg() patch. > > > --- > > > Changes in v2: > > > - Patch 1 > > > =A0 * Added helper struct device variable as suggested by Andy; > > > =A0 * Removed the braces as suggested by David. > > > - Link to v1: > > > https://lore.kernel.org/r/20251203-iio-axi-dac-minor-changes-v1-0-b54= 650cbeb33@analog.com > > > --- > > > =A0drivers/iio/dac/adi-axi-dac.c | 63 +++++++++++++++++++++----------= ------------ > > > =A01 file changed, 30 insertions(+), 33 deletions(-) > > >=20 > > > diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-= dac.c > > > index 0d525272a8a8..ceab9f6fa3b4 100644 > > > --- a/drivers/iio/dac/adi-axi-dac.c > > > +++ b/drivers/iio/dac/adi-axi-dac.c =20 > >=20 > > =20 > > > =A0 /* Let's get the core read only configuration */ > > > =A0 ret =3D regmap_read(st->regmap, AXI_DAC_CONFIG_REG, &st->reg_conf= ig); > > > @@ -975,34 +972,34 @@ static int axi_dac_probe(struct platform_device= *pdev) > > > =A0 > > > =A0 mutex_init(&st->lock); > > > =A0 > > > - ret =3D devm_iio_backend_register(&pdev->dev, st->info->backend_inf= o, st); > > > + ret =3D devm_iio_backend_register(dev, st->info->backend_info, st); > > > =A0 if (ret) > > > - return dev_err_probe(&pdev->dev, ret, > > > + return dev_err_probe(dev, ret, > > > =A0 =A0=A0=A0=A0 "failed to register iio backend\n"); > > > =A0 > > > - device_for_each_child_node_scoped(&pdev->dev, child) { > > > + device_for_each_child_node_scoped(dev, child) { > > > =A0 int val; > > > =A0 > > > =A0 if (!st->info->has_child_nodes) > > > - return dev_err_probe(&pdev->dev, -EINVAL, > > > + return dev_err_probe(dev, -EINVAL, > > > =A0 =A0=A0=A0=A0 "invalid fdt axi-dac compatible."); > > > =A0 > > > =A0 /* Processing only reg 0 node */ > > > =A0 ret =3D fwnode_property_read_u32(child, "reg", &val); > > > =A0 if (ret) > > > - return dev_err_probe(&pdev->dev, ret, > > > + return dev_err_probe(dev, ret, > > > =A0 "invalid reg property."); > > > =A0 if (val !=3D 0) > > > - return dev_err_probe(&pdev->dev, -EINVAL, > > > + return dev_err_probe(dev, -EINVAL, > > > =A0 "invalid node address."); > > > =A0 > > > =A0 ret =3D axi_dac_create_platform_device(st, child); > > > =A0 if (ret) > > > - return dev_err_probe(&pdev->dev, -EINVAL, > > > - "cannot create device."); > > > + return dev_err_probe(dev, -EINVAL, > > > + =A0=A0=A0=A0 "cannot create device."); =20 > > I'm not against this fixing up the indent but why not the ones above ht= at look > > just as bad? =20 >=20 > Hmm I think this one were my automated fingers... Maybe the best thing to= do is > to split up the patches and take care of these indents in the patch adding > the local struct device *dev variable. Does that works for you? Yes. Sounds good to me. J >=20 > - Nuno S=E1 > =20 >=20 >=20 > > =20