summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2017-07-15 11:58:18 +0200
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2017-07-16 18:44:29 +0200
commit1055790b0df7202e363a55817688e3edbe1498a4 (patch)
tree02f1788943cc8a049e1f652200958dada3ba7a38 /drivers/leds
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff)
downloadlinux-1055790b0df7202e363a55817688e3edbe1498a4.tar.bz2
leds: tlc591xx: merge conditional tests
Merge conditionals that have the same then branch, to prepare for extending that branch with of_node_put. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-tlc591xx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
index 304531644938..fcc87ee82453 100644
--- a/drivers/leds/leds-tlc591xx.c
+++ b/drivers/leds/leds-tlc591xx.c
@@ -232,9 +232,8 @@ tlc591xx_probe(struct i2c_client *client,
err = of_property_read_u32(child, "reg", &reg);
if (err)
return err;
- if (reg < 0 || reg >= tlc591xx->max_leds)
- return -EINVAL;
- if (priv->leds[reg].active)
+ if (reg < 0 || reg >= tlc591xx->max_leds ||
+ priv->leds[reg].active)
return -EINVAL;
priv->leds[reg].active = true;
priv->leds[reg].ldev.name =