diff options
Diffstat (limited to 'drivers/media/video/omap24xxcam.c')
-rw-r--r-- | drivers/media/video/omap24xxcam.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index 5fc4ac0d88f..7400eacb4d6 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c | |||
@@ -1450,12 +1450,11 @@ static int omap24xxcam_mmap(struct file *file, struct vm_area_struct *vma) | |||
1450 | 1450 | ||
1451 | static int omap24xxcam_open(struct file *file) | 1451 | static int omap24xxcam_open(struct file *file) |
1452 | { | 1452 | { |
1453 | int minor = video_devdata(file)->minor; | ||
1454 | struct omap24xxcam_device *cam = omap24xxcam.priv; | 1453 | struct omap24xxcam_device *cam = omap24xxcam.priv; |
1455 | struct omap24xxcam_fh *fh; | 1454 | struct omap24xxcam_fh *fh; |
1456 | struct v4l2_format format; | 1455 | struct v4l2_format format; |
1457 | 1456 | ||
1458 | if (!cam || !cam->vfd || (cam->vfd->minor != minor)) | 1457 | if (!cam || !cam->vfd) |
1459 | return -ENODEV; | 1458 | return -ENODEV; |
1460 | 1459 | ||
1461 | fh = kzalloc(sizeof(*fh), GFP_KERNEL); | 1460 | fh = kzalloc(sizeof(*fh), GFP_KERNEL); |
@@ -1660,7 +1659,6 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s) | |||
1660 | 1659 | ||
1661 | strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name)); | 1660 | strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name)); |
1662 | vfd->fops = &omap24xxcam_fops; | 1661 | vfd->fops = &omap24xxcam_fops; |
1663 | vfd->minor = -1; | ||
1664 | vfd->ioctl_ops = &omap24xxcam_ioctl_fops; | 1662 | vfd->ioctl_ops = &omap24xxcam_ioctl_fops; |
1665 | 1663 | ||
1666 | omap24xxcam_hwinit(cam); | 1664 | omap24xxcam_hwinit(cam); |
@@ -1671,14 +1669,14 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s) | |||
1671 | 1669 | ||
1672 | if (video_register_device(vfd, VFL_TYPE_GRABBER, video_nr) < 0) { | 1670 | if (video_register_device(vfd, VFL_TYPE_GRABBER, video_nr) < 0) { |
1673 | dev_err(cam->dev, "could not register V4L device\n"); | 1671 | dev_err(cam->dev, "could not register V4L device\n"); |
1674 | vfd->minor = -1; | ||
1675 | rval = -EBUSY; | 1672 | rval = -EBUSY; |
1676 | goto err; | 1673 | goto err; |
1677 | } | 1674 | } |
1678 | 1675 | ||
1679 | omap24xxcam_poweron_reset(cam); | 1676 | omap24xxcam_poweron_reset(cam); |
1680 | 1677 | ||
1681 | dev_info(cam->dev, "registered device video%d\n", vfd->minor); | 1678 | dev_info(cam->dev, "registered device %s\n", |
1679 | video_device_node_name(vfd)); | ||
1682 | 1680 | ||
1683 | return 0; | 1681 | return 0; |
1684 | 1682 | ||
@@ -1695,7 +1693,7 @@ static void omap24xxcam_device_unregister(struct v4l2_int_device *s) | |||
1695 | omap24xxcam_sensor_exit(cam); | 1693 | omap24xxcam_sensor_exit(cam); |
1696 | 1694 | ||
1697 | if (cam->vfd) { | 1695 | if (cam->vfd) { |
1698 | if (cam->vfd->minor == -1) { | 1696 | if (!video_is_registered(cam->vfd)) { |
1699 | /* | 1697 | /* |
1700 | * The device was never registered, so release the | 1698 | * The device was never registered, so release the |
1701 | * video_device struct directly. | 1699 | * video_device struct directly. |