aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-05-10 16:06:38 +0200
committerThierry Reding <thierry.reding@gmail.com>2021-05-25 18:18:07 +0200
commit5447e7833629ee4208b7d41862ab0249d6b50077 (patch)
tree5334a81168670f9abaf166dc6986b55535d910d1 /drivers/pwm
parentpwm: Make of_pwm_xlate_with_flags() work with #pwm-cells = <2> (diff)
downloadlinux-dev-5447e7833629ee4208b7d41862ab0249d6b50077.tar.xz
linux-dev-5447e7833629ee4208b7d41862ab0249d6b50077.zip
pwm: Drop of_pwm_simple_xlate() in favour of of_pwm_xlate_with_flags()
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>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/core.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 6d3a1c84b053..821ee1959816 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -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;
}