Skip to content

Commit 2f2fce0

Browse files
jwrdegoedemchehab
authored andcommitted
media: atomisp: Remove struct atomisp_sub_device index field
Remove the struct atomisp_sub_device. This was used for 2 things: 1. In dev_dbg() messages 2. To set the name of the v4l2_subdev for each struct atomisp_sub_device Now that only 1 subdev is used neither is useful anymore. Remove the _%d postfix from the v4l2_subdev name and remove the logging of the asd index from the dev_dbg() messages. In case of the atomisp_s_input() check to see if an input/sensor has already been assigned to another subdev the entire check no longer makes sense, so instead of changing the dev_err() message there just drop the entire check. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 401e0e4 commit 2f2fce0

4 files changed

Lines changed: 11 additions & 37 deletions

File tree

drivers/staging/media/atomisp/pci/atomisp_cmd.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,8 @@ irqreturn_t atomisp_isr(int irq, void *dev)
522522
if (irq_infos & IA_CSS_IRQ_INFO_ISYS_EVENTS_READY) {
523523
while (ia_css_dequeue_isys_event(&eof_event.event) == 0) {
524524
atomisp_eof_event(&isp->asd, eof_event.event.exp_id);
525-
dev_dbg_ratelimited(isp->dev,
526-
"%s ISYS event: EOF exp_id %d, asd %d\n",
527-
__func__, eof_event.event.exp_id,
528-
isp->asd.index);
525+
dev_dbg_ratelimited(isp->dev, "ISYS event: EOF exp_id %d\n",
526+
eof_event.event.exp_id);
529527
}
530528

531529
irq_infos &= ~IA_CSS_IRQ_INFO_ISYS_EVENTS_READY;
@@ -3298,10 +3296,8 @@ int atomisp_set_parameters(struct video_device *vdev,
32983296
return -EINVAL;
32993297
}
33003298

3301-
dev_dbg(asd->isp->dev,
3302-
"%s: set parameter(per_frame_setting %d) for asd%d with isp_config_id %d of %s\n",
3303-
__func__, arg->per_frame_setting, asd->index,
3304-
arg->isp_config_id, vdev->name);
3299+
dev_dbg(asd->isp->dev, "set parameter(per_frame_setting %d) isp_config_id %d of %s\n",
3300+
arg->per_frame_setting, arg->isp_config_id, vdev->name);
33053301

33063302
if (IS_ISP2401) {
33073303
if (atomisp_is_vf_pipe(pipe) && arg->per_frame_setting) {
@@ -4512,9 +4508,8 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f)
45124508
return -EINVAL;
45134509

45144510
dev_dbg(isp->dev,
4515-
"setting resolution %ux%u on pad %u for asd%d, bytesperline %u\n",
4516-
f->fmt.pix.width, f->fmt.pix.height, source_pad,
4517-
asd->index, f->fmt.pix.bytesperline);
4511+
"setting resolution %ux%u on pad %u bytesperline %u\n",
4512+
f->fmt.pix.width, f->fmt.pix.height, source_pad, f->fmt.pix.bytesperline);
45184513

45194514
v4l2_fh_init(&fh.vfh, vdev);
45204515

drivers/staging/media/atomisp/pci/atomisp_ioctl.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -671,18 +671,6 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
671671
return -EINVAL;
672672
}
673673

674-
/*
675-
* check whether the request camera:
676-
* 1: already in use
677-
* 2: if in use, whether it is used by other streams
678-
*/
679-
if (isp->inputs[input].asd && isp->inputs[input].asd != asd) {
680-
dev_err(isp->dev,
681-
"%s, camera is already used by stream: %d\n", __func__,
682-
isp->inputs[input].asd->index);
683-
return -EBUSY;
684-
}
685-
686674
camera = isp->inputs[input].camera;
687675
if (!camera) {
688676
dev_err(isp->dev, "%s, no camera\n", __func__);
@@ -1106,9 +1094,8 @@ static int atomisp_dqbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer
11061094
buf->reserved2 = pipe->frame_config_id[buf->index];
11071095

11081096
dev_dbg(isp->dev,
1109-
"dqbuf buffer %d (%s) for asd%d with exp_id %d, isp_config_id %d\n",
1110-
buf->index, vdev->name, asd->index, buf->reserved >> 16,
1111-
buf->reserved2);
1097+
"dqbuf buffer %d (%s) with exp_id %d, isp_config_id %d\n",
1098+
buf->index, vdev->name, buf->reserved >> 16, buf->reserved2);
11121099
return 0;
11131100
}
11141101

@@ -1186,8 +1173,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count)
11861173

11871174
mutex_lock(&isp->mutex);
11881175

1189-
dev_dbg(isp->dev, "Start stream on pad %d for asd%d\n",
1190-
atomisp_subdev_source_pad(vdev), asd->index);
1176+
dev_dbg(isp->dev, "Start stream on pad %d\n", atomisp_subdev_source_pad(vdev));
11911177

11921178
ret = atomisp_pipe_check(pipe, false);
11931179
if (ret)
@@ -1320,8 +1306,7 @@ void atomisp_stop_streaming(struct vb2_queue *vq)
13201306

13211307
mutex_lock(&isp->mutex);
13221308

1323-
dev_dbg(isp->dev, "Stop stream on pad %d for asd%d\n",
1324-
atomisp_subdev_source_pad(vdev), asd->index);
1309+
dev_dbg(isp->dev, "Stop stream on pad %d\n", atomisp_subdev_source_pad(vdev));
13251310

13261311
/*
13271312
* There is no guarantee that the buffers queued to / owned by the ISP

drivers/staging/media/atomisp/pci/atomisp_subdev.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
918918
int ret;
919919

920920
v4l2_subdev_init(sd, &isp_subdev_v4l2_ops);
921-
sprintf(sd->name, "ATOMISP_SUBDEV_%d", asd->index);
921+
sprintf(sd->name, "ATOMISP_SUBDEV");
922922
v4l2_set_subdevdata(sd, asd);
923923
sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
924924

@@ -1161,7 +1161,6 @@ int atomisp_subdev_init(struct atomisp_device *isp)
11611161
{
11621162
int ret;
11631163

1164-
isp->asd.index = 0;
11651164
isp->asd.isp = isp;
11661165
isp_subdev_init_params(&isp->asd);
11671166
ret = isp_subdev_init_entities(&isp->asd);

drivers/staging/media/atomisp/pci/atomisp_subdev.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,6 @@ struct atomisp_sub_device {
315315
unsigned int streaming;
316316
bool stream_prepared; /* whether css stream is created */
317317

318-
/* subdev index: will be used to show which subdev is holding the
319-
* resource, like which camera is used by which subdev
320-
*/
321-
unsigned int index;
322-
323318
unsigned int latest_preview_exp_id; /* CSS ZSL/SDV raw buffer id */
324319

325320
unsigned int mipi_frame_size;

0 commit comments

Comments
 (0)