]> www.infradead.org Git - users/willy/xarray.git/commitdiff
pwm: Use -EINVAL for unsupported polarity
authorThierry Reding <thierry.reding@gmail.com>
Wed, 11 Nov 2020 20:18:11 +0000 (21:18 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 17 Dec 2020 13:18:59 +0000 (14:18 +0100)
Instead of using a mix of -EOPNOTSUPP and -ENOTSUPP, use the more
standard -EINVAL to signal that the specified polarity value was
invalid.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-crc.c
drivers/pwm/pwm-iqs620a.c
drivers/pwm/pwm-rcar.c

index ecfdfac0c2d9349ba2f2154768ef2f645d0eab20..1e2276808b7ae3415537cd677486dc3bcdac7129 100644 (file)
@@ -64,7 +64,7 @@ static int crc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        }
 
        if (state->polarity != PWM_POLARITY_NORMAL)
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (pwm_is_enabled(pwm) && !state->enabled) {
                err = regmap_write(crc_pwm->regmap, BACKLIGHT_EN, 0);
index 7d33e364643601e1ccce4d6f2ba399ce822cc740..5ede8255926ef906e45ba9d950ebbd9fa2567fa6 100644 (file)
@@ -50,7 +50,7 @@ static int iqs620_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        int ret;
 
        if (state->polarity != PWM_POLARITY_NORMAL)
-               return -ENOTSUPP;
+               return -EINVAL;
 
        if (state->period < IQS620_PWM_PERIOD_NS)
                return -EINVAL;
index 3e23f1e4e1f60ed5114096a0ec0cd37c99194f50..002ab79a7ec24ce73389ec98c002e982a65da363 100644 (file)
@@ -168,7 +168,7 @@ static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 
        /* This HW/driver only supports normal polarity */
        if (state->polarity != PWM_POLARITY_NORMAL)
-               return -ENOTSUPP;
+               return -EINVAL;
 
        if (!state->enabled) {
                rcar_pwm_disable(rp);