summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2020-01-24 19:54:07 +0300
committerPavel Machek <pavel@ucw.cz>2020-02-26 23:49:39 +0300
commitb43a8f01fccbfdddbc7f9b2bbad11b7db3fda4e1 (patch)
tree1103db2b307b668e281a54ed0a98b90305d84981 /drivers/leds
parent64d7e23115dd91997858eb0c370d798a0d6bf118 (diff)
downloadlinux-b43a8f01fccbfdddbc7f9b2bbad11b7db3fda4e1.tar.xz
leds: pwm: simplify if condition
.pwm_period_ns is an unsigned integer. So when led->pwm_period_ns > 0 is false, we now assign 0 to a value that is already 0, so it doesn't hurt and we can skip checking the actual value. Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Tested-by: Jeff LaBundy <jeff@labundy.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-pwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 8b6965a563e9..b72fd89ff390 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -102,7 +102,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
pwm_get_args(led_data->pwm, &pargs);
led_data->period = pargs.period;
- if (!led_data->period && (led->pwm_period_ns > 0))
+ if (!led_data->period)
led_data->period = led->pwm_period_ns;
ret = devm_led_classdev_register(dev, &led_data->cdev);