Skip to content

Commit 827804d

Browse files
Sakari AilusHans Verkuil
authored andcommitted
media: ccs: Fix a (harmless) lockdep warning
The v4l2_subdev_init_finalize() is a macro that creates an unique lockdep key and name. As the CCS driver initialises all three of its sub-devices using the same call site, this creates a lockdep warning. Address it. Fixes: d8bca3e ("media: ccs: Use sub-device active state") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 256b776 commit 827804d

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

drivers/media/i2c/ccs/ccs-core.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,9 @@ static void ccs_cleanup(struct ccs_sensor *sensor)
29552955

29562956
static int ccs_init_subdev(struct ccs_sensor *sensor,
29572957
struct ccs_subdev *ssd, const char *name,
2958-
unsigned short num_pads, u32 function)
2958+
unsigned short num_pads, u32 function,
2959+
const char *lock_name,
2960+
struct lock_class_key *lock_key)
29592961
{
29602962
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
29612963
int rval;
@@ -2993,7 +2995,7 @@ static int ccs_init_subdev(struct ccs_sensor *sensor,
29932995
return rval;
29942996
}
29952997

2996-
rval = v4l2_subdev_init_finalize(&ssd->sd);
2998+
rval = __v4l2_subdev_init_finalize(&ssd->sd, lock_name, lock_key);
29972999
if (rval) {
29983000
media_entity_cleanup(&ssd->sd.entity);
29993001
return rval;
@@ -3206,6 +3208,8 @@ static int ccs_firmware_name(struct i2c_client *client,
32063208

32073209
static int ccs_probe(struct i2c_client *client)
32083210
{
3211+
static struct lock_class_key pixel_array_lock_key, binner_lock_key,
3212+
scaler_lock_key;
32093213
const struct ccs_device *ccsdev = device_get_match_data(&client->dev);
32103214
struct ccs_sensor *sensor;
32113215
const struct firmware *fw;
@@ -3489,15 +3493,18 @@ static int ccs_probe(struct i2c_client *client)
34893493
}
34903494

34913495
rval = ccs_init_subdev(sensor, sensor->scaler, " scaler", 2,
3492-
MEDIA_ENT_F_PROC_VIDEO_SCALER);
3496+
MEDIA_ENT_F_PROC_VIDEO_SCALER,
3497+
"ccs scaler mutex", &scaler_lock_key);
34933498
if (rval)
34943499
goto out_cleanup;
34953500
rval = ccs_init_subdev(sensor, sensor->binner, " binner", 2,
3496-
MEDIA_ENT_F_PROC_VIDEO_SCALER);
3501+
MEDIA_ENT_F_PROC_VIDEO_SCALER,
3502+
"ccs binner mutex", &binner_lock_key);
34973503
if (rval)
34983504
goto out_cleanup;
34993505
rval = ccs_init_subdev(sensor, sensor->pixel_array, " pixel_array", 1,
3500-
MEDIA_ENT_F_CAM_SENSOR);
3506+
MEDIA_ENT_F_CAM_SENSOR, "ccs pixel array mutex",
3507+
&pixel_array_lock_key);
35013508
if (rval)
35023509
goto out_cleanup;
35033510

0 commit comments

Comments
 (0)