mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
media: rcar-vin: Use correct count of remote subdevices
When extending the driver with Gen4 support the iteration of over possible remote subdevices changed from being R-Car CSI-2 Rx only to also cover R-Car CSISP instances. In two loops updating the bounds variable was missed. This had no ill effect as the count the two values have always been the same in the past. Fix it by looking at the array size. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20250613153434.2001800-2-niklas.soderlund+renesas@ragnatech.se Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
40823233ca
commit
1b83fa6eb9
|
|
@ -213,7 +213,7 @@ static int rvin_group_entity_to_remote_id(struct rvin_group *group,
|
|||
|
||||
sd = media_entity_to_v4l2_subdev(entity);
|
||||
|
||||
for (i = 0; i < RVIN_REMOTES_MAX; i++)
|
||||
for (i = 0; i < ARRAY_SIZE(group->remotes); i++)
|
||||
if (group->remotes[i].subdev == sd)
|
||||
return i;
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ static void rvin_group_notify_unbind(struct v4l2_async_notifier *notifier,
|
|||
|
||||
mutex_lock(&vin->group->lock);
|
||||
|
||||
for (i = 0; i < RVIN_CSI_MAX; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(vin->group->remotes); i++) {
|
||||
if (vin->group->remotes[i].asc != asc)
|
||||
continue;
|
||||
vin->group->remotes[i].subdev = NULL;
|
||||
|
|
@ -284,7 +284,7 @@ static int rvin_group_notify_bound(struct v4l2_async_notifier *notifier,
|
|||
|
||||
mutex_lock(&vin->group->lock);
|
||||
|
||||
for (i = 0; i < RVIN_CSI_MAX; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(vin->group->remotes); i++) {
|
||||
if (vin->group->remotes[i].asc != asc)
|
||||
continue;
|
||||
vin->group->remotes[i].subdev = subdev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user