[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241207182333.00a23c47@jic23-huawei>
Date: Sat, 7 Dec 2024 18:23:33 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: prabhakar.mahadev-lad.rj@...renesas.com, lars@...afoo.de,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
geert+renesas@...der.be, magnus.damm@...il.com, mturquette@...libre.com,
sboyd@...nel.org, p.zabel@...gutronix.de, linux-iio@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org, Claudiu Beznea
<claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v2 03/15] iio: adc: rzg2l_adc: Use devres helpers to
request pre-deasserted reset controls
On Fri, 6 Dec 2024 13:13:25 +0200
Claudiu <claudiu.beznea@...on.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>
> Starting with commit d872bed85036 ("reset: Add devres helpers to request
> pre-deasserted reset controls"), devres helpers are available to simplify
> the process of requesting pre-deasserted reset controls. Update the
> rzg2l_adc driver to utilize these helpers, reducing complexity in this
> way.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
> ---
>
> Changes in v2:
> - rebased on top of patch 2/15 from this version
> - used "failed to get/deassert" failure messages
>
> drivers/iio/adc/rzg2l_adc.c | 37 ++++++-------------------------------
> 1 file changed, 6 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
> index 8a804f81c04b..c0c13e99aa92 100644
> --- a/drivers/iio/adc/rzg2l_adc.c
> +++ b/drivers/iio/adc/rzg2l_adc.c
> @@ -411,11 +411,6 @@ static void rzg2l_adc_pm_runtime_set_suspended(void *data)
> pm_runtime_set_suspended(dev->parent);
> }
>
> -static void rzg2l_adc_reset_assert(void *data)
> -{
> - reset_control_assert(data);
> -}
> -
> static int rzg2l_adc_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -448,34 +443,14 @@ static int rzg2l_adc_probe(struct platform_device *pdev)
> if (IS_ERR(adc->adclk))
> return dev_err_probe(dev, PTR_ERR(adc->adclk), "Failed to get adclk");
>
> - adc->adrstn = devm_reset_control_get_exclusive(dev, "adrst-n");
> + adc->adrstn = devm_reset_control_get_exclusive_deasserted(dev, "adrst-n");
> if (IS_ERR(adc->adrstn))
> - return dev_err_probe(dev, PTR_ERR(adc->adrstn), "failed to get adrstn\n");
> -
> - adc->presetn = devm_reset_control_get_exclusive(dev, "presetn");
> - if (IS_ERR(adc->presetn))
> - return dev_err_probe(dev, PTR_ERR(adc->presetn), "failed to get presetn\n");
> -
> - ret = reset_control_deassert(adc->adrstn);
> - if (ret)
> - return dev_err_probe(&pdev->dev, ret, "failed to deassert adrstn pin, %d\n", ret);
> -
> - ret = devm_add_action_or_reset(&pdev->dev,
> - rzg2l_adc_reset_assert, adc->adrstn);
> - if (ret) {
Huh. Missed this in previous. These brackets shouldn't be there.
> - return dev_err_probe(&pdev->dev, ret,
> - "failed to register adrstn assert devm action, %d\n", ret);
> - }
> + return dev_err_probe(dev, PTR_ERR(adc->adrstn), "failed to get/deassert adrst-n\n");
>
> - ret = reset_control_deassert(adc->presetn);
> - if (ret)
> - return dev_err_probe(&pdev->dev, ret, "failed to deassert presetn pin, %d\n", ret);
> -
> - ret = devm_add_action_or_reset(&pdev->dev,
> - rzg2l_adc_reset_assert, adc->presetn);
> - if (ret) {
> - return dev_err_probe(&pdev->dev, ret,
> - "failed to register presetn assert devm action, %d\n", ret);
> + adc->presetn = devm_reset_control_get_exclusive_deasserted(dev, "presetn");
> + if (IS_ERR(adc->presetn)) {
Adding bracket here both makes limited sense and messes up the diff. I dropped them.
Jonathan
> + return dev_err_probe(dev, PTR_ERR(adc->presetn),
> + "failed to get/deassert presetn\n");
> }
>
> ret = rzg2l_adc_hw_init(adc);
Powered by blists - more mailing lists