[media] smiapp: Take mutex during PLL update in sensor initialisation
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 16 Sep 2014 18:57:07 +0000 (15:57 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Oct 2014 15:32:46 +0000 (13:32 -0200)
The mutex does not serialise anything in this case but avoids a lockdep
warning from the control framework.

Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c

index 932ed9be9ff3d756fb35948e8183e09faaa60c34..6174a592adcc3f917a0d8e85b2939b12052bd9a7 100644 (file)
@@ -2677,7 +2677,9 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
                pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
        pll->scale_n = sensor->limits[SMIAPP_LIMIT_SCALER_N_MIN];
 
+       mutex_lock(&sensor->mutex);
        rval = smiapp_update_mode(sensor);
+       mutex_unlock(&sensor->mutex);
        if (rval) {
                dev_err(&client->dev, "update mode failed\n");
                goto out_nvm_release;