Message ID | 20211108134628.120474-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] pwm: meson: Drop always false check from .request() | expand |
On Mon, Nov 8, 2021 at 2:46 PM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > > In .request() pwm_get_chip_data() returns NULL always since commit > e926b12c611c ("pwm: Clear chip_data in pwm_put()"). (And if it didn't > returning 0 would be wrong because then .request() wouldn't reenable > the clk which the other driver code depends on.) > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
On Mon, Nov 08, 2021 at 02:46:24PM +0100, Uwe Kleine-König wrote: > In .request() pwm_get_chip_data() returns NULL always since commit > e926b12c611c ("pwm: Clear chip_data in pwm_put()"). (And if it didn't > returning 0 would be wrong because then .request() wouldn't reenable > the clk which the other driver code depends on.) > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > drivers/pwm/pwm-meson.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) All four patches applied, thanks. Thierry
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 3cf3bcf5ddfc..be3c806b57e4 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -120,16 +120,10 @@ static inline struct meson_pwm *to_meson_pwm(struct pwm_chip *chip) static int meson_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) { struct meson_pwm *meson = to_meson_pwm(chip); - struct meson_pwm_channel *channel; + struct meson_pwm_channel *channel = &meson->channels[pwm->hwpwm]; struct device *dev = chip->dev; int err; - channel = pwm_get_chip_data(pwm); - if (channel) - return 0; - - channel = &meson->channels[pwm->hwpwm]; - if (channel->clk_parent) { err = clk_set_parent(channel->clk, channel->clk_parent); if (err < 0) {
In .request() pwm_get_chip_data() returns NULL always since commit e926b12c611c ("pwm: Clear chip_data in pwm_put()"). (And if it didn't returning 0 would be wrong because then .request() wouldn't reenable the clk which the other driver code depends on.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-meson.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) base-commit: 6b75d88fa81b122cce37ebf17428a849ccd3d0f1