mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
i2c: at91: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Also, add a missing clk_disable_unprepare(). Signed-off-by: Arvind Yadav <[email protected]> Acked-by: Ludovic Desroches <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
5c8e3ab146
commit
56a6cb8865
1 changed files with 6 additions and 2 deletions
|
|
@ -1083,12 +1083,16 @@ static int at91_twi_probe(struct platform_device *pdev)
|
|||
dev_err(dev->dev, "no clock defined\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
clk_prepare_enable(dev->clk);
|
||||
rc = clk_prepare_enable(dev->clk);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (dev->dev->of_node) {
|
||||
rc = at91_twi_configure_dma(dev, phy_addr);
|
||||
if (rc == -EPROBE_DEFER)
|
||||
if (rc == -EPROBE_DEFER) {
|
||||
clk_disable_unprepare(dev->clk);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (!of_property_read_u32(pdev->dev.of_node, "atmel,fifo-size",
|
||||
|
|
|
|||
Loading…
Reference in a new issue