]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: rspi: Simplify reset control handling
authorFelix Gu <ustc.gu@gmail.com>
Thu, 7 May 2026 14:06:36 +0000 (22:06 +0800)
committerMark Brown <broonie@kernel.org>
Sat, 16 May 2026 02:21:42 +0000 (11:21 +0900)
Use devm_reset_control_get_optional_exclusive_deasserted() to combine
get + deassert + cleanup in a single call, removing the redundant
rspi_reset_control_assert() helper.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260507-rspi-v1-1-8cfa47cd56aa@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rspi.c

index 951e9a8af547279e54e95eb7bf0bbd2985d12211..a0c77e02bc90d7ccf549d205d01fc9692b9e5d2e 100644 (file)
@@ -1222,11 +1222,6 @@ static const struct of_device_id rspi_of_match[] __maybe_unused = {
 MODULE_DEVICE_TABLE(of, rspi_of_match);
 
 #ifdef CONFIG_OF
-static void rspi_reset_control_assert(void *data)
-{
-       reset_control_assert(data);
-}
-
 static int rspi_parse_dt(struct device *dev, struct spi_controller *ctlr)
 {
        struct reset_control *rstc;
@@ -1242,22 +1237,10 @@ static int rspi_parse_dt(struct device *dev, struct spi_controller *ctlr)
 
        ctlr->num_chipselect = num_cs;
 
-       rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
+       rstc = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
        if (IS_ERR(rstc))
                return dev_err_probe(dev, PTR_ERR(rstc),
-                                            "failed to get reset ctrl\n");
-
-       error = reset_control_deassert(rstc);
-       if (error) {
-               dev_err(dev, "failed to deassert reset %d\n", error);
-               return error;
-       }
-
-       error = devm_add_action_or_reset(dev, rspi_reset_control_assert, rstc);
-       if (error) {
-               dev_err(dev, "failed to register assert devm action, %d\n", error);
-               return error;
-       }
+                                    "failed to get reset ctrl and deassert reset\n");
 
        return 0;
 }