[media] smiapp: Make clock control optional
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 29 Aug 2017 12:41:25 +0000 (09:41 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 4 Oct 2017 20:25:26 +0000 (17:25 -0300)
The clock control is not explicitly controlled by the driver in two cases:
ACPI based systems and when the clock is part of the power sequence of the
camera module.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c

index 009b5e2..fbd851b 100644 (file)
@@ -2892,7 +2892,10 @@ static int smiapp_probe(struct i2c_client *client,
        }
 
        sensor->ext_clk = devm_clk_get(&client->dev, NULL);
-       if (IS_ERR(sensor->ext_clk)) {
+       if (PTR_ERR(sensor->ext_clk) == -ENOENT) {
+               dev_info(&client->dev, "no clock defined, continuing...\n");
+               sensor->ext_clk = NULL;
+       } else if (IS_ERR(sensor->ext_clk)) {
                dev_err(&client->dev, "could not get clock (%ld)\n",
                        PTR_ERR(sensor->ext_clk));
                return -EPROBE_DEFER;