[V2,1/3] pwm: bcm2835: suppress error message for invalid period_ns
diff mbox series

Message ID 1566655788-24949-2-git-send-email-wahrenst@gmx.net
State New
Headers show
Series
  • pwm: bcm2835: Minor fixes
Related show

Commit Message

Stefan Wahren Aug. 24, 2019, 2:09 p.m. UTC
The PWM config can be triggered via sysfs, so we better suppress the
error message in case of an invalid period to avoid kernel log spamming.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Uwe Kleine-K├Ânig <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-bcm2835.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.7.4

Patch
diff mbox series

diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
index f6fe0b9..5276306 100644
--- a/drivers/pwm/pwm-bcm2835.c
+++ b/drivers/pwm/pwm-bcm2835.c
@@ -72,11 +72,8 @@  static int bcm2835_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,

 	scaler = DIV_ROUND_CLOSEST(NSEC_PER_SEC, rate);

-	if (period_ns <= MIN_PERIOD) {
-		dev_err(pc->dev, "period %d not supported, minimum %d\n",
-			period_ns, MIN_PERIOD);
+	if (period_ns <= MIN_PERIOD)
 		return -EINVAL;
-	}

 	writel(DIV_ROUND_CLOSEST(duty_ns, scaler),
 	       pc->base + DUTY(pwm->hwpwm));