[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8vvDYwzgQ51rTiYBoRkcy0pQvM-mNW3QCitnfROrTDUYQ@mail.gmail.com>
Date: Sun, 8 Dec 2024 19:44:20 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: prabhakar.mahadev-lad.rj@...renesas.com, jic23@...nel.org, 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, Dec 6, 2024 at 11:14 AM 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(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cheers,
Prabhakar
> 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) {
> - 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)) {
> + return dev_err_probe(dev, PTR_ERR(adc->presetn),
> + "failed to get/deassert presetn\n");
> }
>
> ret = rzg2l_adc_hw_init(adc);
> --
> 2.39.2
>
>
Powered by blists - more mailing lists