diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-01-10 00:34:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-30 10:49:18 +0300 |
commit | c0a241e2f3b6ef112f943c88d104d3f1c0baea48 (patch) | |
tree | 0129f852e982aa9cd982b9d72862c4ae9abfb9a3 /drivers/pwm | |
parent | f1cf38947558e07b1c96750174fd6845bd095dc4 (diff) | |
download | linux-c0a241e2f3b6ef112f943c88d104d3f1c0baea48.tar.xz |
pwm: Drop duplicate check against chip->npwm in of_pwm_xlate_with_flags()
[ Upstream commit 91bb23493f8fd115e362d075ebaa3e6f12d1439d ]
args->args[0] is passed as parameter "index" to pwm_request_from_chip().
The latter function also checks for index >= npwm, so
of_pwm_xlate_with_flags() doesn't need to do that.
Link: https://lore.kernel.org/r/b06e445a6ed62a339add727eccb969a33d678386.1704835845.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Stable-dep-of: 3e551115aee0 ("pwm: meson: Add check for error from clk_round_rate()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/core.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 606d9ef0c709..b025d90e201c 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -111,9 +111,6 @@ of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *arg if (args->args_count < 1) return ERR_PTR(-EINVAL); - if (args->args[0] >= chip->npwm) - return ERR_PTR(-EINVAL); - pwm = pwm_request_from_chip(chip, args->args[0], NULL); if (IS_ERR(pwm)) return pwm; |