]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00227873-1 pxp/v4l2: make the v4l2 output device index auto assigned
authorRobby Cai <R63905@freescale.com>
Wed, 10 Oct 2012 07:17:27 +0000 (15:17 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:36 +0000 (08:35 +0200)
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>
drivers/media/video/mxc/output/mxc_pxp_v4l2.c

index a3a8294efb8eeb9ea355b1176efbb805e85acb91..c17f9f1d9cdce757503140aa7fd5b3d5206567c8 100644 (file)
@@ -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");