summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2012-10-10 15:17:27 +0800
committerRobby Cai <R63905@freescale.com>2012-10-23 11:02:54 +0800
commit1010a2c7ebd5da7a998a3db6ff4f222be7c61458 (patch)
tree2cbd0fd1f24a0057c3ebcc75397ab907314bb37e /drivers
parentd3162b067687c33c7dde368dd9b8243c06ebe956 (diff)
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 <R63905@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/output/mxc_pxp_v4l2.c4
1 files changed, 3 insertions, 1 deletions
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");