pwm: bcm2835: Suppress error message for invalid period_ns

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>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
Stefan Wahren 2019-08-24 16:09:46 +02:00 коммит произвёл Thierry Reding
Родитель c79468b895
Коммит 4537e52a52
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -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));