From 1055790b0df7202e363a55817688e3edbe1498a4 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sat, 15 Jul 2017 11:58:18 +0200 Subject: [PATCH] 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 Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-tlc591xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index 30453164..fcc87ee 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 = -- 2.7.4