pwm: Drop of_pwm_simple_xlate() in favour of of_pwm_xlate_with_flags()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 10 May 2021 14:06:38 +0000 (16:06 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 25 May 2021 16:18:07 +0000 (18:18 +0200)
Since the previous commit the latter function can do everything that the
former does. So simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c

index 6d3a1c8..821ee19 100644 (file)
@@ -152,38 +152,13 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
 }
 EXPORT_SYMBOL_GPL(of_pwm_xlate_with_flags);
 
-static struct pwm_device *
-of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
-{
-       struct pwm_device *pwm;
-
-       /* sanity check driver support */
-       if (pc->of_pwm_n_cells < 2)
-               return ERR_PTR(-EINVAL);
-
-       /* all cells are required */
-       if (args->args_count != pc->of_pwm_n_cells)
-               return ERR_PTR(-EINVAL);
-
-       if (args->args[0] >= pc->npwm)
-               return ERR_PTR(-EINVAL);
-
-       pwm = pwm_request_from_chip(pc, args->args[0], NULL);
-       if (IS_ERR(pwm))
-               return pwm;
-
-       pwm->args.period = args->args[1];
-
-       return pwm;
-}
-
 static void of_pwmchip_add(struct pwm_chip *chip)
 {
        if (!chip->dev || !chip->dev->of_node)
                return;
 
        if (!chip->of_xlate) {
-               chip->of_xlate = of_pwm_simple_xlate;
+               chip->of_xlate = of_pwm_xlate_with_flags;
                chip->of_pwm_n_cells = 2;
        }