From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: "Nuno Sá via B4 Relay" <devnull+nuno.sa.analog.com@kernel.org>
Cc: <nuno.sa@analog.com>, <linux-iio@vger.kernel.org>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH v2] iio: dac: adi-axi-dac: Make use of dev_err_probe()
Date: Fri, 19 Dec 2025 16:21:29 +0000 [thread overview]
Message-ID: <20251219162129.00006aa9@huawei.com> (raw)
In-Reply-To: <20251219-iio-axi-dac-minor-changes-v2-1-e9fccc019b01@analog.com>
On Fri, 19 Dec 2025 15:54:29 +0000
Nuno Sá via B4 Relay <devnull+nuno.sa.analog.com@kernel.org> wrote:
> From: Nuno Sá <nuno.sa@analog.com>
>
> Be consistent and use dev_err_probe() as in all other places in the
> .probe() path.
>
> 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.
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
This has turned into a bit of an X and Y and Z patch. In theory
should be split up but I guess it's not too bad.
However I'm not sure why you fixed one indent and left a bunch of similar
cases looking worse?
Jonathan
> ---
> Ended up dropping the dev_info() -> dev_dbg() patch.
> ---
> Changes in v2:
> - Patch 1
> * Added helper struct device variable as suggested by Andy;
> * Removed the braces as suggested by David.
> - Link to v1: https://lore.kernel.org/r/20251203-iio-axi-dac-minor-changes-v1-0-b54650cbeb33@analog.com
> ---
> drivers/iio/dac/adi-axi-dac.c | 63 +++++++++++++++++++++----------------------
> 1 file changed, 30 insertions(+), 33 deletions(-)
>
> 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
> /* Let's get the core read only configuration */
> ret = regmap_read(st->regmap, AXI_DAC_CONFIG_REG, &st->reg_config);
> @@ -975,34 +972,34 @@ static int axi_dac_probe(struct platform_device *pdev)
>
> mutex_init(&st->lock);
>
> - ret = devm_iio_backend_register(&pdev->dev, st->info->backend_info, st);
> + ret = devm_iio_backend_register(dev, st->info->backend_info, st);
> if (ret)
> - return dev_err_probe(&pdev->dev, ret,
> + return dev_err_probe(dev, ret,
> "failed to register iio backend\n");
>
> - device_for_each_child_node_scoped(&pdev->dev, child) {
> + device_for_each_child_node_scoped(dev, child) {
> int val;
>
> if (!st->info->has_child_nodes)
> - return dev_err_probe(&pdev->dev, -EINVAL,
> + return dev_err_probe(dev, -EINVAL,
> "invalid fdt axi-dac compatible.");
>
> /* Processing only reg 0 node */
> ret = fwnode_property_read_u32(child, "reg", &val);
> if (ret)
> - return dev_err_probe(&pdev->dev, ret,
> + return dev_err_probe(dev, ret,
> "invalid reg property.");
> if (val != 0)
> - return dev_err_probe(&pdev->dev, -EINVAL,
> + return dev_err_probe(dev, -EINVAL,
> "invalid node address.");
>
> ret = axi_dac_create_platform_device(st, child);
> if (ret)
> - return dev_err_probe(&pdev->dev, -EINVAL,
> - "cannot create device.");
> + return dev_err_probe(dev, -EINVAL,
> + "cannot create device.");
I'm not against this fixing up the indent but why not the ones above htat look
just as bad?
> }
>
> - dev_info(&pdev->dev, "AXI DAC IP core (%d.%.2d.%c) probed\n",
> + dev_info(dev, "AXI DAC IP core (%d.%.2d.%c) probed\n",
> ADI_AXI_PCORE_VER_MAJOR(ver),
> ADI_AXI_PCORE_VER_MINOR(ver),
> ADI_AXI_PCORE_VER_PATCH(ver));
>
> ---
> base-commit: f9e05791642810a0cf6237d39fafd6fec5e0b4bb
> change-id: 20251203-iio-axi-dac-minor-changes-945fa5f2e1eb
> --
>
> Thanks!
> - Nuno Sá
>
>
>
>
next prev parent reply other threads:[~2025-12-19 16:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 15:54 [PATCH v2] iio: dac: adi-axi-dac: Make use of dev_err_probe() Nuno Sá
2025-12-19 15:54 ` Nuno Sá via B4 Relay
2025-12-19 16:21 ` Jonathan Cameron [this message]
2025-12-19 17:46 ` Nuno Sá
2025-12-19 18:43 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219162129.00006aa9@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=devnull+nuno.sa.analog.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.