[media] smiapp: Call limits quirk immediately after retrieving the limits
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 15 Apr 2014 17:59:42 +0000 (14:59 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 23 May 2014 14:29:56 +0000 (11:29 -0300)
Some of the limits are used before the limits quirk is called. Move the call
immediately after obtaining the limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c

index da4422e8cbb42ab9c1eb8876169dee26a96b2d38..0a74e145e1d2fe7c7adf56ad7499a2c8c01510e2 100644 (file)
@@ -2423,6 +2423,12 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
                sensor->hvflip_inv_mask = SMIAPP_IMAGE_ORIENTATION_HFLIP |
                                          SMIAPP_IMAGE_ORIENTATION_VFLIP;
 
+       rval = smiapp_call_quirk(sensor, limits);
+       if (rval) {
+               dev_err(&client->dev, "limits quirks failed\n");
+               goto out_power_off;
+       }
+
        rval = smiapp_get_mbus_formats(sensor);
        if (rval) {
                rval = -ENODEV;
@@ -2483,12 +2489,6 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
                }
        }
 
-       rval = smiapp_call_quirk(sensor, limits);
-       if (rval) {
-               dev_err(&client->dev, "limits quirks failed\n");
-               goto out_nvm_release;
-       }
-
        /* We consider this as profile 0 sensor if any of these are zero. */
        if (!sensor->limits[SMIAPP_LIMIT_MIN_OP_SYS_CLK_DIV] ||
            !sensor->limits[SMIAPP_LIMIT_MAX_OP_SYS_CLK_DIV] ||