From 1010a2c7ebd5da7a998a3db6ff4f222be7c61458 Mon Sep 17 00:00:00 2001 From: Robby Cai Date: Wed, 10 Oct 2012 15:17:27 +0800 Subject: ENGR00227873-1 pxp/v4l2: make the v4l2 output device index auto assigned It used the hard-coded '0' for historical reason. This patch changes it to -1 to make video device minor to be automatically assigned. Signed-off-by: Robby Cai --- drivers/media/video/mxc/output/mxc_pxp_v4l2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c index a3a8294efb8e..c17f9f1d9cdc 100644 --- a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c @@ -54,6 +54,7 @@ #define V4L2_OUTPUT_TYPE_INTERNAL 4 +static int video_nr = -1; /* -1 ==> auto assign */ static struct pxp_data_format pxp_s0_formats[] = { { .name = "24-bit RGB", @@ -1175,7 +1176,7 @@ static int pxp_probe(struct platform_device *pdev) memcpy(pxp->vdev, &pxp_template, sizeof(pxp_template)); video_set_drvdata(pxp->vdev, pxp); - err = video_register_device(pxp->vdev, VFL_TYPE_GRABBER, 0); + err = video_register_device(pxp->vdev, VFL_TYPE_GRABBER, video_nr); if (err) { dev_err(&pdev->dev, "failed to register video device\n"); goto freevdev; @@ -1235,6 +1236,7 @@ static void __exit pxp_exit(void) module_init(pxp_init); module_exit(pxp_exit); +module_param(video_nr, int, 0444); MODULE_DESCRIPTION("MXC PxP V4L2 driver"); MODULE_AUTHOR("Freescale Semiconductor, Inc."); MODULE_LICENSE("GPL"); -- cgit v1.2.3