Skip to content

Commit

Permalink
media: rockchip/vpu: Do not request id 0 for our video device
Browse files Browse the repository at this point in the history
Pass -1 to video_register_device() to let the core assign the first
free id instead of trying to get id 0.
In practice it doesn't make a difference since video_register_device()
is not strict about id requests and will anyway pick the first free id
starting at the id passed in argument, and passing -1 has the same
effect as passing 0. But let's comply with the API doc and pass -1
here.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Jonas Karlman authored and Mauro Carvalho Chehab committed May 15, 2019
1 parent 1199fa8 commit 76f2db0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int rockchip_vpu_video_device_register(struct rockchip_vpu_dev *vpu)
vpu->vfd_enc = vfd;
video_set_drvdata(vfd, vpu);

ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1);
if (ret) {
v4l2_err(&vpu->v4l2_dev, "Failed to register video device\n");
goto err_free_dev;
Expand Down

0 comments on commit 76f2db0

Please sign in to comment.