summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-pxa.c
diff options
context:
space:
mode:
authorDoug Brown <doug@schmorgal.com>2022-12-02 21:35:20 +0300
committerThierry Reding <thierry.reding@gmail.com>2022-12-06 14:46:12 +0300
commitf956b838934ab06deeee2ce9d5c8dfe64e4beb24 (patch)
treedc16391d9f92d9ab60ee4944e6afe8443e3a4f91 /drivers/pwm/pwm-pxa.c
parent241eab76657f72d82a5a77ef7d7958c6e07dd2b0 (diff)
downloadlinux-f956b838934ab06deeee2ce9d5c8dfe64e4beb24.tar.xz
pwm: pxa: Remove pxa_pwm_enable/disable
These functions are only acting as wrappers for clk_prepare_enable and clk_disable_unprepare now, so remove them to simplify the driver. Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Doug Brown <doug@schmorgal.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221113233639.24244-2-doug@schmorgal.com 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/pwm-pxa.c')
-rw-r--r--drivers/pwm/pwm-pxa.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 0bcaa58c6a91..0ac052652c62 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -101,23 +101,10 @@ static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
return 0;
}
-static int pxa_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
-{
- struct pxa_pwm_chip *pc = to_pxa_pwm_chip(chip);
-
- return clk_prepare_enable(pc->clk);
-}
-
-static void pxa_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
-{
- struct pxa_pwm_chip *pc = to_pxa_pwm_chip(chip);
-
- clk_disable_unprepare(pc->clk);
-}
-
static int pxa_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{
+ struct pxa_pwm_chip *pc = to_pxa_pwm_chip(chip);
int err;
if (state->polarity != PWM_POLARITY_NORMAL)
@@ -125,7 +112,7 @@ static int pxa_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (!state->enabled) {
if (pwm->state.enabled)
- pxa_pwm_disable(chip, pwm);
+ clk_disable_unprepare(pc->clk);
return 0;
}
@@ -135,7 +122,7 @@ static int pxa_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
return err;
if (!pwm->state.enabled)
- return pxa_pwm_enable(chip, pwm);
+ return clk_prepare_enable(pc->clk);
return 0;
}