[2/2,media] adv7180: Remove the unneeded 'err' label

Message ID 1418748547-12308-2-git-send-email-fabio.estevam@freescale.com (mailing list archive)
State Accepted, archived
Delegated to: Hans Verkuil
Headers

Commit Message

Fabio Estevam Dec. 16, 2014, 4:49 p.m. UTC
  There is no need to jump to the 'err' label as we can simply return the error
code directly and make the code shorter.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/media/i2c/adv7180.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Lars-Peter Clausen Jan. 16, 2015, 11:30 a.m. UTC | #1
On 12/16/2014 05:49 PM, Fabio Estevam wrote:
> There is no need to jump to the 'err' label as we can simply return the error
> code directly and make the code shorter.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 0c1268a..456bf2d 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -616,10 +616,8 @@  static int adv7180_probe(struct i2c_client *client,
 		 client->addr, client->adapter->name);
 
 	state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
-	if (state == NULL) {
-		ret = -ENOMEM;
-		goto err;
-	}
+	if (state == NULL)
+		return -ENOMEM;
 
 	state->irq = client->irq;
 	mutex_init(&state->mutex);
@@ -649,7 +647,6 @@  err_free_ctrl:
 	adv7180_exit_controls(state);
 err_unreg_subdev:
 	mutex_destroy(&state->mutex);
-err:
 	return ret;
 }