media: max2175: Propagate the real error on devm_clk_get() failure
authorFabio Estevam <[email protected]>
Sun, 27 Aug 2017 16:30:35 +0000 (12:30 -0400)
committerMauro Carvalho Chehab <[email protected]>
Sun, 27 Aug 2017 22:14:11 +0000 (18:14 -0400)
When devm_clk_get() fails we should return the real error code
instead of always returning -ENODEV.

This allows defer probe to happen in the case the clock provider has
not been enabled by the time max2175 driver gets probed.

Signed-off-by: Fabio Estevam <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/i2c/max2175.c

index a4736a8a7792f3d9cf8c9235b524ea1f1a0175c4..bf0e821a2b9334cb874f2bcd051dd26a25788f04 100644 (file)
@@ -1319,7 +1319,7 @@ static int max2175_probe(struct i2c_client *client,
        if (IS_ERR(clk)) {
                ret = PTR_ERR(clk);
                dev_err(&client->dev, "cannot get clock %d\n", ret);
-               return -ENODEV;
+               return ret;
        }
 
        regmap = devm_regmap_init_i2c(client, &max2175_regmap_config);