diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2017-07-15 11:58:18 +0200 |
---|---|---|
committer | Jacek Anaszewski <jacek.anaszewski@gmail.com> | 2017-07-16 18:44:29 +0200 |
commit | 1055790b0df7202e363a55817688e3edbe1498a4 (patch) | |
tree | 02f1788943cc8a049e1f652200958dada3ba7a38 /drivers/leds/leds-tlc591xx.c | |
parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) |
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/leds-tlc591xx.c')
-rw-r--r-- | drivers/leds/leds-tlc591xx.c | 5 |
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", ®); 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 = |