Commit 2b1c1a5d authored by Thierry Reding's avatar Thierry Reding
Browse files

pwm: Use -EINVAL for unsupported polarity



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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent f14a8f0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);