Skip to content

Commit 1c5d33f

Browse files
Andi Shytiwsakernel
authored andcommitted
i2c: nomadik: Remove unnecessary goto label
The err_no_mem goto label doesn't do anything. Remove it. Signed-off-by: Andi Shyti <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent a7fbfd4 commit 1c5d33f

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

drivers/i2c/busses/i2c-nomadik.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -971,10 +971,9 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
971971
u32 max_fifo_threshold = (vendor->fifodepth / 2) - 1;
972972

973973
dev = devm_kzalloc(&adev->dev, sizeof(*dev), GFP_KERNEL);
974-
if (!dev) {
975-
ret = -ENOMEM;
976-
goto err_no_mem;
977-
}
974+
if (!dev)
975+
return -ENOMEM;
976+
978977
dev->vendor = vendor;
979978
dev->adev = adev;
980979
nmk_i2c_of_probe(np, dev);
@@ -995,30 +994,27 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
995994

996995
dev->virtbase = devm_ioremap(&adev->dev, adev->res.start,
997996
resource_size(&adev->res));
998-
if (!dev->virtbase) {
999-
ret = -ENOMEM;
1000-
goto err_no_mem;
1001-
}
997+
if (!dev->virtbase)
998+
return -ENOMEM;
1002999

10031000
dev->irq = adev->irq[0];
10041001
ret = devm_request_irq(&adev->dev, dev->irq, i2c_irq_handler, 0,
10051002
DRIVER_NAME, dev);
10061003
if (ret) {
10071004
dev_err(&adev->dev, "cannot claim the irq %d\n", dev->irq);
1008-
goto err_no_mem;
1005+
return ret;
10091006
}
10101007

10111008
dev->clk = devm_clk_get(&adev->dev, NULL);
10121009
if (IS_ERR(dev->clk)) {
10131010
dev_err(&adev->dev, "could not get i2c clock\n");
1014-
ret = PTR_ERR(dev->clk);
1015-
goto err_no_mem;
1011+
return PTR_ERR(dev->clk);
10161012
}
10171013

10181014
ret = clk_prepare_enable(dev->clk);
10191015
if (ret) {
10201016
dev_err(&adev->dev, "can't prepare_enable clock\n");
1021-
goto err_no_mem;
1017+
return ret;
10221018
}
10231019

10241020
init_hw(dev);
@@ -1049,7 +1045,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
10491045

10501046
err_no_adap:
10511047
clk_disable_unprepare(dev->clk);
1052-
err_no_mem:
10531048

10541049
return ret;
10551050
}

0 commit comments

Comments
 (0)