Skip to content

Commit

Permalink
kernel: ubnt-ledbar: return directly
Browse files Browse the repository at this point in the history
Removes ret variable.

Signed-off-by: Rosen Penev <[email protected]>
Link: openwrt/openwrt#16508
Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
neheb authored and hauke committed Oct 3, 2024
1 parent f09d973 commit d3e5a4d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb
struct led_classdev *led_cdev)
{
struct led_init_data init_data = {};
int ret;

if (!np)
return 0;
Expand All @@ -158,12 +157,7 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb

led_cdev->max_brightness = UBNT_LEDBAR_MAX_BRIGHTNESS;

ret = devm_led_classdev_register_ext(&ledbar->client->dev, led_cdev,
&init_data);
if (ret)
dev_err(&ledbar->client->dev, "led register err: %d\n", ret);

return ret;
return devm_led_classdev_register_ext(&ledbar->client->dev, led_cdev, &init_data);
}

static int ubnt_ledbar_probe(struct i2c_client *client)
Expand Down

0 comments on commit d3e5a4d

Please sign in to comment.