Skip to content

Commit

Permalink
reset: uniphier-glue: Use devm_reset_control_bulk_get_shared_deassert…
Browse files Browse the repository at this point in the history
…ed()

Replace the pattern devm_reset_control_bulk_get_shared() /
reset_control_bulk_deassert() / devm_add_action_or_reset()
with devm_reset_control_bulk_get_shared_deasserted() for
some reduction in boilerplate.

Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240925-reset-get-deasserted-v2-3-b3601bbd0458@pengutronix.de
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Philipp Zabel committed Oct 1, 2024
1 parent d872bed commit c0260e2
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions drivers/reset/reset-uniphier-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ static void uniphier_clk_disable(void *_priv)
clk_bulk_disable_unprepare(priv->data->nclks, priv->clk);
}

static void uniphier_rst_assert(void *_priv)
{
struct uniphier_glue_reset_priv *priv = _priv;

reset_control_bulk_assert(priv->data->nrsts, priv->rst);
}

static int uniphier_glue_reset_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -68,13 +61,6 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
if (ret)
return ret;

for (i = 0; i < priv->data->nrsts; i++)
priv->rst[i].id = priv->data->reset_names[i];
ret = devm_reset_control_bulk_get_shared(dev, priv->data->nrsts,
priv->rst);
if (ret)
return ret;

ret = clk_bulk_prepare_enable(priv->data->nclks, priv->clk);
if (ret)
return ret;
Expand All @@ -83,11 +69,11 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
if (ret)
return ret;

ret = reset_control_bulk_deassert(priv->data->nrsts, priv->rst);
if (ret)
return ret;

ret = devm_add_action_or_reset(dev, uniphier_rst_assert, priv);
for (i = 0; i < priv->data->nrsts; i++)
priv->rst[i].id = priv->data->reset_names[i];
ret = devm_reset_control_bulk_get_shared_deasserted(dev,
priv->data->nrsts,
priv->rst);
if (ret)
return ret;

Expand Down

0 comments on commit c0260e2

Please sign in to comment.