media: staging: atomisp: Remove non-ACPI leftovers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 19 Dec 2017 20:59:52 +0000 (15:59 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 29 Dec 2017 11:26:55 +0000 (06:26 -0500)
Since all drivers are solely requiring ACPI enumeration, there is no
need to additionally check for legacy platform data or ACPI handle.

Remove leftovers from the sensors and platform code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
drivers/staging/media/atomisp/i2c/ov8858.c
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c

index e70d8afcc2295b52d7ee98799feda592cf0b7a37..61b7598469eb484d9f6692a54653ba74cc39310e 100644 (file)
@@ -1370,13 +1370,9 @@ static int gc0310_probe(struct i2c_client *client)
        dev->fmt_idx = 0;
        v4l2_i2c_subdev_init(&(dev->sd), client, &gc0310_ops);
 
-       if (ACPI_COMPANION(&client->dev))
-               pdata = gmin_camera_platform_data(&dev->sd,
-                                                 ATOMISP_INPUT_FORMAT_RAW_8,
-                                                 atomisp_bayer_order_grbg);
-       else
-               pdata = client->dev.platform_data;
-
+       pdata = gmin_camera_platform_data(&dev->sd,
+                                         ATOMISP_INPUT_FORMAT_RAW_8,
+                                         atomisp_bayer_order_grbg);
        if (!pdata) {
                ret = -EINVAL;
                goto out_free;
index 85da5fe240339c16694f9b2acc54dbcea191efde..d8de46da64aeb628fec49a301b5526f9632ba26c 100644 (file)
@@ -1108,9 +1108,7 @@ static int gc2235_probe(struct i2c_client *client)
        dev->fmt_idx = 0;
        v4l2_i2c_subdev_init(&(dev->sd), client, &gc2235_ops);
 
-       gcpdev = client->dev.platform_data;
-       if (ACPI_COMPANION(&client->dev))
-               gcpdev = gmin_camera_platform_data(&dev->sd,
+       gcpdev = gmin_camera_platform_data(&dev->sd,
                                   ATOMISP_INPUT_FORMAT_RAW_10,
                                   atomisp_bayer_order_grbg);
 
@@ -1147,10 +1145,8 @@ static int gc2235_probe(struct i2c_client *client)
        if (ret)
                gc2235_remove(client);
 
-       if (ACPI_HANDLE(&client->dev))
-               ret = atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
+       return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
 
-       return ret;
 out_free:
        v4l2_device_unregister_subdev(&dev->sd);
        kfree(dev);
index 974b6ff50c7a3c09dc5cf943bd6dc2247615c854..7098bf317f16420449610ad587f4048269362fb8 100644 (file)
@@ -824,22 +824,15 @@ static void *lm3554_platform_data_func(struct i2c_client *client)
 {
        static struct lm3554_platform_data platform_data;
 
-       if (ACPI_COMPANION(&client->dev)) {
-               platform_data.gpio_reset =
-                   desc_to_gpio(gpiod_get_index(&(client->dev),
+       platform_data.gpio_reset =
+                   desc_to_gpio(gpiod_get_index(&client->dev,
                                                 NULL, 2, GPIOD_OUT_LOW));
-               platform_data.gpio_strobe =
-                   desc_to_gpio(gpiod_get_index(&(client->dev),
+       platform_data.gpio_strobe =
+                   desc_to_gpio(gpiod_get_index(&client->dev,
                                                 NULL, 0, GPIOD_OUT_LOW));
-               platform_data.gpio_torch =
-                   desc_to_gpio(gpiod_get_index(&(client->dev),
+       platform_data.gpio_torch =
+                   desc_to_gpio(gpiod_get_index(&client->dev,
                                                 NULL, 1, GPIOD_OUT_LOW));
-       } else {
-               platform_data.gpio_reset = -1;
-               platform_data.gpio_strobe = -1;
-               platform_data.gpio_torch = -1;
-       }
-
        dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n",
                platform_data.gpio_reset, platform_data.gpio_strobe,
                platform_data.gpio_torch);
@@ -868,10 +861,7 @@ static int lm3554_probe(struct i2c_client *client)
        if (!flash)
                return -ENOMEM;
 
-       flash->pdata = client->dev.platform_data;
-
-       if (!flash->pdata || ACPI_COMPANION(&client->dev))
-               flash->pdata = lm3554_platform_data_func(client);
+       flash->pdata = lm3554_platform_data_func(client);
 
        v4l2_i2c_subdev_init(&flash->sd, client, &lm3554_ops);
        flash->sd.internal_ops = &lm3554_internal_ops;
@@ -914,9 +904,7 @@ static int lm3554_probe(struct i2c_client *client)
                dev_err(&client->dev, "gpio request/direction_output fail");
                goto fail2;
        }
-       if (ACPI_HANDLE(&client->dev))
-               err = atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
-       return 0;
+       return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
 fail2:
        media_entity_cleanup(&flash->sd.entity);
        v4l2_ctrl_handler_free(&flash->ctrl_handler);
index 55882bea20495e977efa5855b45a2ce6aa8a5c41..df253a557c76ff5d7e5dcbc0270b3e5a91366294 100644 (file)
@@ -1844,11 +1844,9 @@ static int mt9m114_probe(struct i2c_client *client)
                return -ENOMEM;
 
        v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops);
-       pdata = client->dev.platform_data;
-       if (ACPI_COMPANION(&client->dev))
-               pdata = gmin_camera_platform_data(&dev->sd,
-                                                 ATOMISP_INPUT_FORMAT_RAW_10,
-                                                 atomisp_bayer_order_grbg);
+       pdata = gmin_camera_platform_data(&dev->sd,
+                                         ATOMISP_INPUT_FORMAT_RAW_10,
+                                         atomisp_bayer_order_grbg);
        if (pdata)
                ret = mt9m114_s_config(&dev->sd, client->irq, pdata);
        if (!pdata || ret) {
index cd67d38f183aac831d4910119c4697a64a978159..84f8d33ce2d122be3ecca99229ff581113069e01 100644 (file)
@@ -1447,13 +1447,9 @@ static int ov2680_probe(struct i2c_client *client)
        dev->fmt_idx = 0;
        v4l2_i2c_subdev_init(&(dev->sd), client, &ov2680_ops);
 
-       if (ACPI_COMPANION(&client->dev))
-               pdata = gmin_camera_platform_data(&dev->sd,
-                                                 ATOMISP_INPUT_FORMAT_RAW_10,
-                                                 atomisp_bayer_order_bggr);
-       else
-               pdata = client->dev.platform_data;
-
+       pdata = gmin_camera_platform_data(&dev->sd,
+                                         ATOMISP_INPUT_FORMAT_RAW_10,
+                                         atomisp_bayer_order_bggr);
        if (!pdata) {
                ret = -EINVAL;
                goto out_free;
index 4df7eba8d375b0c4a1ed0b2efc4589990d8e65ac..2b6ae0faf972ad14c6d47fbd42d9444f13aa3cff 100644 (file)
@@ -1259,7 +1259,6 @@ static int ov2722_probe(struct i2c_client *client)
        struct ov2722_device *dev;
        void *ovpdev;
        int ret;
-       struct acpi_device *adev;
 
        dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (!dev)
@@ -1270,14 +1269,9 @@ static int ov2722_probe(struct i2c_client *client)
        dev->fmt_idx = 0;
        v4l2_i2c_subdev_init(&(dev->sd), client, &ov2722_ops);
 
-       ovpdev = client->dev.platform_data;
-       adev = ACPI_COMPANION(&client->dev);
-       if (adev) {
-               adev->power.flags.power_resources = 0;
-               ovpdev = gmin_camera_platform_data(&dev->sd,
-                                                  ATOMISP_INPUT_FORMAT_RAW_10,
-                                                  atomisp_bayer_order_grbg);
-       }
+       ovpdev = gmin_camera_platform_data(&dev->sd,
+                                          ATOMISP_INPUT_FORMAT_RAW_10,
+                                          atomisp_bayer_order_grbg);
 
        ret = ov2722_s_config(&dev->sd, client->irq, ovpdev);
        if (ret)
@@ -1296,10 +1290,7 @@ static int ov2722_probe(struct i2c_client *client)
        if (ret)
                ov2722_remove(client);
 
-       if (ACPI_HANDLE(&client->dev))
-               ret = atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
-
-       return ret;
+       return atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
 
 out_ctrl_handler_free:
        v4l2_ctrl_handler_free(&dev->ctrl_handler);
index d934a086ac46086d2b66f31614f53df1db0cd90e..40d01bf4bf28671d1ecc825e543bcae98734fb52 100644 (file)
@@ -1948,7 +1948,6 @@ static int ov5693_probe(struct i2c_client *client)
        int i2c;
        int ret = 0;
        void *pdata = client->dev.platform_data;
-       struct acpi_device *adev;
        unsigned int i;
 
        /*
@@ -1974,14 +1973,9 @@ static int ov5693_probe(struct i2c_client *client)
        dev->fmt_idx = 0;
        v4l2_i2c_subdev_init(&(dev->sd), client, &ov5693_ops);
 
-       adev = ACPI_COMPANION(&client->dev);
-       if (adev) {
-               adev->power.flags.power_resources = 0;
-               pdata = gmin_camera_platform_data(&dev->sd,
-                                                 ATOMISP_INPUT_FORMAT_RAW_10,
-                                                 atomisp_bayer_order_bggr);
-       }
-
+       pdata = gmin_camera_platform_data(&dev->sd,
+                                         ATOMISP_INPUT_FORMAT_RAW_10,
+                                         atomisp_bayer_order_bggr);
        if (!pdata)
                goto out_free;
 
index ba147ac2e36fa2be4c0e9cbaadfc389f98634299..3cf8c710ac65ba711199334d8aa213afcc2f9d84 100644 (file)
@@ -2077,29 +2077,28 @@ static int ov8858_probe(struct i2c_client *client)
 
        v4l2_i2c_subdev_init(&(dev->sd), client, &ov8858_ops);
 
-       if (ACPI_COMPANION(&client->dev)) {
-               pdata = gmin_camera_platform_data(&dev->sd,
-                                                 ATOMISP_INPUT_FORMAT_RAW_10,
-                                                 atomisp_bayer_order_bggr);
-               if (!pdata) {
-                       dev_err(&client->dev,
-                               "%s: failed to get acpi platform data\n",
-                               __func__);
-                       goto out_free;
-               }
-               ret = ov8858_s_config(&dev->sd, client->irq, pdata);
-               if (ret) {
-                       dev_err(&client->dev,
-                               "%s: failed to set config\n", __func__);
-                       goto out_free;
-               }
-               ret = atomisp_register_i2c_module(&dev->sd, pdata, RAW_CAMERA);
-               if (ret) {
-                       dev_err(&client->dev,
-                               "%s: failed to register subdev\n", __func__);
-                       goto out_free;
-               }
+       pdata = gmin_camera_platform_data(&dev->sd,
+                                         ATOMISP_INPUT_FORMAT_RAW_10,
+                                         atomisp_bayer_order_bggr);
+       if (!pdata) {
+               dev_err(&client->dev,
+                       "%s: failed to get acpi platform data\n",
+                       __func__);
+               goto out_free;
+       }
+       ret = ov8858_s_config(&dev->sd, client->irq, pdata);
+       if (ret) {
+               dev_err(&client->dev,
+                       "%s: failed to set config\n", __func__);
+               goto out_free;
        }
+       ret = atomisp_register_i2c_module(&dev->sd, pdata, RAW_CAMERA);
+       if (ret) {
+               dev_err(&client->dev,
+                       "%s: failed to register subdev\n", __func__);
+               goto out_free;
+       }
+
        /*
         * sd->name is updated with sensor driver name by the v4l2.
         * change it to sensor name in this case.
index 8fb5147531a5fc620f918a9c855a9db54f5f9f46..8dcec0e780a1b489b041e77cce821189b0a5bb8e 100644 (file)
@@ -114,7 +114,7 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
        struct i2c_board_info *bi;
        struct gmin_subdev *gs;
        struct i2c_client *client = v4l2_get_subdevdata(subdev);
-       struct acpi_device *adev;
+       struct acpi_device *adev = ACPI_COMPANION(&client->dev);
 
        dev_info(&client->dev, "register atomisp i2c module type %d\n", type);
 
@@ -124,9 +124,7 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
         * tickled during suspend/resume.  This has caused power and
         * performance issues on multiple devices.
         */
-       adev = ACPI_COMPANION(&client->dev);
-       if (adev)
-               adev->power.flags.power_resources = 0;
+       adev->power.flags.power_resources = 0;
 
        for (i = 0; i < MAX_SUBDEVS; i++)
                if (!pdata.subdevs[i].type)