]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i2c: s3c2410: Check clk_prepare_enable() return value
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 20 Apr 2016 14:37:56 +0000 (10:37 -0400)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 25 Apr 2016 22:32:07 +0000 (00:32 +0200)
The clk_prepare_enable() function can fail so check the return
value and propagate the error in case of a failure.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-s3c2410.c

index c0883054957891fd83a8d8ae17bf002df2d21637..38dc1cacfd8bba5d36da9e2638efb6a6ca93f455 100644 (file)
@@ -1158,7 +1158,12 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
                return -EINVAL;
 
        /* initialise the i2c controller */
-       clk_prepare_enable(i2c->clk);
+       ret = clk_prepare_enable(i2c->clk);
+       if (ret) {
+               dev_err(&pdev->dev, "I2C clock enable failed\n");
+               return ret;
+       }
+
        ret = s3c24xx_i2c_init(i2c);
        clk_disable(i2c->clk);
        if (ret != 0) {