Commit 91bb2349 authored by Uwe Kleine-König's avatar Uwe Kleine-König

pwm: Drop duplicate check against chip->npwm in of_pwm_xlate_with_flags()

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.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 0e253d41
...@@ -111,9 +111,6 @@ of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *arg ...@@ -111,9 +111,6 @@ of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *arg
if (args->args_count < 1) if (args->args_count < 1)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
if (args->args[0] >= chip->npwm)
return ERR_PTR(-EINVAL);
pwm = pwm_request_from_chip(chip, args->args[0], NULL); pwm = pwm_request_from_chip(chip, args->args[0], NULL);
if (IS_ERR(pwm)) if (IS_ERR(pwm))
return pwm; return pwm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment