diff options
author | David Phillips <david@yeah.nah.nz> | 2021-05-21 22:32:36 +1200 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2021-05-21 22:32:36 +1200 |
commit | 9ea2d46ebe5713cbdabb3ae028bb2fc27e93c00d (patch) | |
tree | 6a36ac1ffd9ade9afc200f3cd93aa4db59c27d6b | |
parent | 2b10511b25eec631d3b97867ba58b73ae56e4fa7 (diff) | |
download | cds9k-9ea2d46ebe5713cbdabb3ae028bb2fc27e93c00d.tar.xz |
led: simplify probe return logic
-rw-r--r-- | cds9k-led.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cds9k-led.c b/cds9k-led.c index 9e211f9..55f4ce7 100644 --- a/cds9k-led.c +++ b/cds9k-led.c @@ -27,7 +27,7 @@ int cds9k_led_blink_set(struct led_classdev *led_cdev, unsigned long blink_value; /* Only 50% duty is supported by controller, so we ignore delay_off */ blink_value = MS_TO_CDS9K(*delay_on); - if (blink_value >= 255) { + if (blink_value > 255) { blink_value = 255; } *delay_off = *delay_on = CDS9K_TO_MS(blink_value); @@ -97,11 +97,7 @@ static int cds9k_led_probe(struct platform_device *pdev) init_data.fwnode = of_fwnode_handle(np); init_data.devicename = "cds9k_led"; - ret = devm_led_classdev_register_ext(&pdev->dev, &led->cdev, &init_data); - if (ret) - return ret; - - return 0; + return devm_led_classdev_register_ext(&pdev->dev, &led->cdev, &init_data); } static struct of_device_id cds9k_led_of_match[] = { @@ -116,7 +112,6 @@ static struct platform_driver cds9k_led = { .of_match_table = cds9k_led_of_match, }, .probe = cds9k_led_probe, - //.shutdown = cds9k_led_shutdown, }; module_platform_driver(cds9k_led); |