diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-09 12:34:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 22:53:34 -0400 |
commit | 60acf187681aa61f339030540aef74e4d0db875e (patch) | |
tree | d689f5d0b025be7795bdd5e3a4b0cfd65d378e8a | |
parent | 2aa689dd80575606a569951467eee6ac98710d33 (diff) |
[media] cx231xx: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-417.c | 33 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-cards.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 94 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx.h | 8 |
4 files changed, 49 insertions, 92 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 3f295b4d1a3d..983ea8339154 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c | |||
@@ -1868,13 +1868,9 @@ void cx231xx_417_unregister(struct cx231xx *dev) | |||
1868 | dprintk(1, "%s()\n", __func__); | 1868 | dprintk(1, "%s()\n", __func__); |
1869 | dprintk(3, "%s()\n", __func__); | 1869 | dprintk(3, "%s()\n", __func__); |
1870 | 1870 | ||
1871 | if (dev->v4l_device) { | 1871 | if (video_is_registered(&dev->v4l_device)) { |
1872 | if (-1 != dev->v4l_device->minor) | 1872 | video_unregister_device(&dev->v4l_device); |
1873 | video_unregister_device(dev->v4l_device); | ||
1874 | else | ||
1875 | video_device_release(dev->v4l_device); | ||
1876 | v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); | 1873 | v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); |
1877 | dev->v4l_device = NULL; | ||
1878 | } | 1874 | } |
1879 | } | 1875 | } |
1880 | 1876 | ||
@@ -1911,25 +1907,21 @@ static struct cx2341x_handler_ops cx231xx_ops = { | |||
1911 | .s_video_encoding = cx231xx_s_video_encoding, | 1907 | .s_video_encoding = cx231xx_s_video_encoding, |
1912 | }; | 1908 | }; |
1913 | 1909 | ||
1914 | static struct video_device *cx231xx_video_dev_alloc( | 1910 | static void cx231xx_video_dev_init( |
1915 | struct cx231xx *dev, | 1911 | struct cx231xx *dev, |
1916 | struct usb_device *usbdev, | 1912 | struct usb_device *usbdev, |
1917 | struct video_device *template, | 1913 | struct video_device *vfd, |
1918 | char *type) | 1914 | const struct video_device *template, |
1915 | const char *type) | ||
1919 | { | 1916 | { |
1920 | struct video_device *vfd; | ||
1921 | |||
1922 | dprintk(1, "%s()\n", __func__); | 1917 | dprintk(1, "%s()\n", __func__); |
1923 | vfd = video_device_alloc(); | ||
1924 | if (NULL == vfd) | ||
1925 | return NULL; | ||
1926 | *vfd = *template; | 1918 | *vfd = *template; |
1927 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, | 1919 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, |
1928 | type, cx231xx_boards[dev->model].name); | 1920 | type, cx231xx_boards[dev->model].name); |
1929 | 1921 | ||
1930 | vfd->v4l2_dev = &dev->v4l2_dev; | 1922 | vfd->v4l2_dev = &dev->v4l2_dev; |
1931 | vfd->lock = &dev->lock; | 1923 | vfd->lock = &dev->lock; |
1932 | vfd->release = video_device_release; | 1924 | vfd->release = video_device_release_empty; |
1933 | vfd->ctrl_handler = &dev->mpeg_ctrl_handler.hdl; | 1925 | vfd->ctrl_handler = &dev->mpeg_ctrl_handler.hdl; |
1934 | video_set_drvdata(vfd, dev); | 1926 | video_set_drvdata(vfd, dev); |
1935 | if (dev->tuner_type == TUNER_ABSENT) { | 1927 | if (dev->tuner_type == TUNER_ABSENT) { |
@@ -1938,9 +1930,6 @@ static struct video_device *cx231xx_video_dev_alloc( | |||
1938 | v4l2_disable_ioctl(vfd, VIDIOC_G_TUNER); | 1930 | v4l2_disable_ioctl(vfd, VIDIOC_G_TUNER); |
1939 | v4l2_disable_ioctl(vfd, VIDIOC_S_TUNER); | 1931 | v4l2_disable_ioctl(vfd, VIDIOC_S_TUNER); |
1940 | } | 1932 | } |
1941 | |||
1942 | return vfd; | ||
1943 | |||
1944 | } | 1933 | } |
1945 | 1934 | ||
1946 | int cx231xx_417_register(struct cx231xx *dev) | 1935 | int cx231xx_417_register(struct cx231xx *dev) |
@@ -1983,9 +1972,9 @@ int cx231xx_417_register(struct cx231xx *dev) | |||
1983 | cx2341x_handler_set_50hz(&dev->mpeg_ctrl_handler, false); | 1972 | cx2341x_handler_set_50hz(&dev->mpeg_ctrl_handler, false); |
1984 | 1973 | ||
1985 | /* Allocate and initialize V4L video device */ | 1974 | /* Allocate and initialize V4L video device */ |
1986 | dev->v4l_device = cx231xx_video_dev_alloc(dev, | 1975 | cx231xx_video_dev_init(dev, dev->udev, |
1987 | dev->udev, &cx231xx_mpeg_template, "mpeg"); | 1976 | &dev->v4l_device, &cx231xx_mpeg_template, "mpeg"); |
1988 | err = video_register_device(dev->v4l_device, | 1977 | err = video_register_device(&dev->v4l_device, |
1989 | VFL_TYPE_GRABBER, -1); | 1978 | VFL_TYPE_GRABBER, -1); |
1990 | if (err < 0) { | 1979 | if (err < 0) { |
1991 | dprintk(3, "%s: can't register mpeg device\n", dev->name); | 1980 | dprintk(3, "%s: can't register mpeg device\n", dev->name); |
@@ -1994,7 +1983,7 @@ int cx231xx_417_register(struct cx231xx *dev) | |||
1994 | } | 1983 | } |
1995 | 1984 | ||
1996 | dprintk(3, "%s: registered device video%d [mpeg]\n", | 1985 | dprintk(3, "%s: registered device video%d [mpeg]\n", |
1997 | dev->name, dev->v4l_device->num); | 1986 | dev->name, dev->v4l_device.num); |
1998 | 1987 | ||
1999 | return 0; | 1988 | return 0; |
2000 | } | 1989 | } |
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index 85220b97e8b2..fe00da105e77 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c | |||
@@ -1230,9 +1230,9 @@ static void cx231xx_create_media_graph(struct cx231xx *dev) | |||
1230 | if (tuner) | 1230 | if (tuner) |
1231 | media_entity_create_link(tuner, 0, decoder, 0, | 1231 | media_entity_create_link(tuner, 0, decoder, 0, |
1232 | MEDIA_LNK_FL_ENABLED); | 1232 | MEDIA_LNK_FL_ENABLED); |
1233 | media_entity_create_link(decoder, 1, &dev->vdev->entity, 0, | 1233 | media_entity_create_link(decoder, 1, &dev->vdev.entity, 0, |
1234 | MEDIA_LNK_FL_ENABLED); | 1234 | MEDIA_LNK_FL_ENABLED); |
1235 | media_entity_create_link(decoder, 2, &dev->vbi_dev->entity, 0, | 1235 | media_entity_create_link(decoder, 2, &dev->vbi_dev.entity, 0, |
1236 | MEDIA_LNK_FL_ENABLED); | 1236 | MEDIA_LNK_FL_ENABLED); |
1237 | #endif | 1237 | #endif |
1238 | } | 1238 | } |
@@ -1748,7 +1748,7 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface) | |||
1748 | if (dev->users) { | 1748 | if (dev->users) { |
1749 | dev_warn(dev->dev, | 1749 | dev_warn(dev->dev, |
1750 | "device %s is open! Deregistration and memory deallocation are deferred on close.\n", | 1750 | "device %s is open! Deregistration and memory deallocation are deferred on close.\n", |
1751 | video_device_node_name(dev->vdev)); | 1751 | video_device_node_name(&dev->vdev)); |
1752 | 1752 | ||
1753 | /* Even having users, it is safe to remove the RC i2c driver */ | 1753 | /* Even having users, it is safe to remove the RC i2c driver */ |
1754 | cx231xx_ir_exit(dev); | 1754 | cx231xx_ir_exit(dev); |
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index acc1b68c408e..c261e160c158 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c | |||
@@ -1129,7 +1129,7 @@ int cx231xx_enum_input(struct file *file, void *priv, | |||
1129 | (CX231XX_VMUX_CABLE == INPUT(n)->type)) | 1129 | (CX231XX_VMUX_CABLE == INPUT(n)->type)) |
1130 | i->type = V4L2_INPUT_TYPE_TUNER; | 1130 | i->type = V4L2_INPUT_TYPE_TUNER; |
1131 | 1131 | ||
1132 | i->std = dev->vdev->tvnorms; | 1132 | i->std = dev->vdev.tvnorms; |
1133 | 1133 | ||
1134 | /* If they are asking about the active input, read signal status */ | 1134 | /* If they are asking about the active input, read signal status */ |
1135 | if (n == dev->video_input) { | 1135 | if (n == dev->video_input) { |
@@ -1524,7 +1524,7 @@ int cx231xx_querycap(struct file *file, void *priv, | |||
1524 | cap->capabilities = cap->device_caps | V4L2_CAP_READWRITE | | 1524 | cap->capabilities = cap->device_caps | V4L2_CAP_READWRITE | |
1525 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_VIDEO_CAPTURE | | 1525 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_VIDEO_CAPTURE | |
1526 | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS; | 1526 | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS; |
1527 | if (dev->radio_dev) | 1527 | if (video_is_registered(&dev->radio_dev)) |
1528 | cap->capabilities |= V4L2_CAP_RADIO; | 1528 | cap->capabilities |= V4L2_CAP_RADIO; |
1529 | 1529 | ||
1530 | return 0; | 1530 | return 0; |
@@ -1802,34 +1802,21 @@ void cx231xx_release_analog_resources(struct cx231xx *dev) | |||
1802 | 1802 | ||
1803 | /*FIXME: I2C IR should be disconnected */ | 1803 | /*FIXME: I2C IR should be disconnected */ |
1804 | 1804 | ||
1805 | if (dev->radio_dev) { | 1805 | if (video_is_registered(&dev->radio_dev)) |
1806 | if (video_is_registered(dev->radio_dev)) | 1806 | video_unregister_device(&dev->radio_dev); |
1807 | video_unregister_device(dev->radio_dev); | 1807 | if (video_is_registered(&dev->vbi_dev)) { |
1808 | else | ||
1809 | video_device_release(dev->radio_dev); | ||
1810 | dev->radio_dev = NULL; | ||
1811 | } | ||
1812 | if (dev->vbi_dev) { | ||
1813 | dev_info(dev->dev, "V4L2 device %s deregistered\n", | 1808 | dev_info(dev->dev, "V4L2 device %s deregistered\n", |
1814 | video_device_node_name(dev->vbi_dev)); | 1809 | video_device_node_name(&dev->vbi_dev)); |
1815 | if (video_is_registered(dev->vbi_dev)) | 1810 | video_unregister_device(&dev->vbi_dev); |
1816 | video_unregister_device(dev->vbi_dev); | ||
1817 | else | ||
1818 | video_device_release(dev->vbi_dev); | ||
1819 | dev->vbi_dev = NULL; | ||
1820 | } | 1811 | } |
1821 | if (dev->vdev) { | 1812 | if (video_is_registered(&dev->vdev)) { |
1822 | dev_info(dev->dev, "V4L2 device %s deregistered\n", | 1813 | dev_info(dev->dev, "V4L2 device %s deregistered\n", |
1823 | video_device_node_name(dev->vdev)); | 1814 | video_device_node_name(&dev->vdev)); |
1824 | 1815 | ||
1825 | if (dev->board.has_417) | 1816 | if (dev->board.has_417) |
1826 | cx231xx_417_unregister(dev); | 1817 | cx231xx_417_unregister(dev); |
1827 | 1818 | ||
1828 | if (video_is_registered(dev->vdev)) | 1819 | video_unregister_device(&dev->vdev); |
1829 | video_unregister_device(dev->vdev); | ||
1830 | else | ||
1831 | video_device_release(dev->vdev); | ||
1832 | dev->vdev = NULL; | ||
1833 | } | 1820 | } |
1834 | v4l2_ctrl_handler_free(&dev->ctrl_handler); | 1821 | v4l2_ctrl_handler_free(&dev->ctrl_handler); |
1835 | v4l2_ctrl_handler_free(&dev->radio_ctrl_handler); | 1822 | v4l2_ctrl_handler_free(&dev->radio_ctrl_handler); |
@@ -2086,7 +2073,7 @@ static struct video_device cx231xx_vbi_template; | |||
2086 | 2073 | ||
2087 | static const struct video_device cx231xx_video_template = { | 2074 | static const struct video_device cx231xx_video_template = { |
2088 | .fops = &cx231xx_v4l_fops, | 2075 | .fops = &cx231xx_v4l_fops, |
2089 | .release = video_device_release, | 2076 | .release = video_device_release_empty, |
2090 | .ioctl_ops = &video_ioctl_ops, | 2077 | .ioctl_ops = &video_ioctl_ops, |
2091 | .tvnorms = V4L2_STD_ALL, | 2078 | .tvnorms = V4L2_STD_ALL, |
2092 | }; | 2079 | }; |
@@ -2122,19 +2109,14 @@ static struct video_device cx231xx_radio_template = { | |||
2122 | 2109 | ||
2123 | /******************************** usb interface ******************************/ | 2110 | /******************************** usb interface ******************************/ |
2124 | 2111 | ||
2125 | static struct video_device *cx231xx_vdev_init(struct cx231xx *dev, | 2112 | static void cx231xx_vdev_init(struct cx231xx *dev, |
2126 | const struct video_device | 2113 | struct video_device *vfd, |
2127 | *template, const char *type_name) | 2114 | const struct video_device *template, |
2115 | const char *type_name) | ||
2128 | { | 2116 | { |
2129 | struct video_device *vfd; | ||
2130 | |||
2131 | vfd = video_device_alloc(); | ||
2132 | if (NULL == vfd) | ||
2133 | return NULL; | ||
2134 | |||
2135 | *vfd = *template; | 2117 | *vfd = *template; |
2136 | vfd->v4l2_dev = &dev->v4l2_dev; | 2118 | vfd->v4l2_dev = &dev->v4l2_dev; |
2137 | vfd->release = video_device_release; | 2119 | vfd->release = video_device_release_empty; |
2138 | vfd->lock = &dev->lock; | 2120 | vfd->lock = &dev->lock; |
2139 | 2121 | ||
2140 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); | 2122 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); |
@@ -2146,7 +2128,6 @@ static struct video_device *cx231xx_vdev_init(struct cx231xx *dev, | |||
2146 | v4l2_disable_ioctl(vfd, VIDIOC_G_TUNER); | 2128 | v4l2_disable_ioctl(vfd, VIDIOC_G_TUNER); |
2147 | v4l2_disable_ioctl(vfd, VIDIOC_S_TUNER); | 2129 | v4l2_disable_ioctl(vfd, VIDIOC_S_TUNER); |
2148 | } | 2130 | } |
2149 | return vfd; | ||
2150 | } | 2131 | } |
2151 | 2132 | ||
2152 | int cx231xx_register_analog_devices(struct cx231xx *dev) | 2133 | int cx231xx_register_analog_devices(struct cx231xx *dev) |
@@ -2189,20 +2170,16 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) | |||
2189 | /* write code here... */ | 2170 | /* write code here... */ |
2190 | 2171 | ||
2191 | /* allocate and fill video video_device struct */ | 2172 | /* allocate and fill video video_device struct */ |
2192 | dev->vdev = cx231xx_vdev_init(dev, &cx231xx_video_template, "video"); | 2173 | cx231xx_vdev_init(dev, &dev->vdev, &cx231xx_video_template, "video"); |
2193 | if (!dev->vdev) { | ||
2194 | dev_err(dev->dev, "cannot allocate video_device.\n"); | ||
2195 | return -ENODEV; | ||
2196 | } | ||
2197 | #if defined(CONFIG_MEDIA_CONTROLLER) | 2174 | #if defined(CONFIG_MEDIA_CONTROLLER) |
2198 | dev->video_pad.flags = MEDIA_PAD_FL_SINK; | 2175 | dev->video_pad.flags = MEDIA_PAD_FL_SINK; |
2199 | ret = media_entity_init(&dev->vdev->entity, 1, &dev->video_pad, 0); | 2176 | ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad, 0); |
2200 | if (ret < 0) | 2177 | if (ret < 0) |
2201 | dev_err(dev->dev, "failed to initialize video media entity!\n"); | 2178 | dev_err(dev->dev, "failed to initialize video media entity!\n"); |
2202 | #endif | 2179 | #endif |
2203 | dev->vdev->ctrl_handler = &dev->ctrl_handler; | 2180 | dev->vdev.ctrl_handler = &dev->ctrl_handler; |
2204 | /* register v4l2 video video_device */ | 2181 | /* register v4l2 video video_device */ |
2205 | ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER, | 2182 | ret = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, |
2206 | video_nr[dev->devno]); | 2183 | video_nr[dev->devno]); |
2207 | if (ret) { | 2184 | if (ret) { |
2208 | dev_err(dev->dev, | 2185 | dev_err(dev->dev, |
@@ -2212,28 +2189,24 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) | |||
2212 | } | 2189 | } |
2213 | 2190 | ||
2214 | dev_info(dev->dev, "Registered video device %s [v4l2]\n", | 2191 | dev_info(dev->dev, "Registered video device %s [v4l2]\n", |
2215 | video_device_node_name(dev->vdev)); | 2192 | video_device_node_name(&dev->vdev)); |
2216 | 2193 | ||
2217 | /* Initialize VBI template */ | 2194 | /* Initialize VBI template */ |
2218 | cx231xx_vbi_template = cx231xx_video_template; | 2195 | cx231xx_vbi_template = cx231xx_video_template; |
2219 | strcpy(cx231xx_vbi_template.name, "cx231xx-vbi"); | 2196 | strcpy(cx231xx_vbi_template.name, "cx231xx-vbi"); |
2220 | 2197 | ||
2221 | /* Allocate and fill vbi video_device struct */ | 2198 | /* Allocate and fill vbi video_device struct */ |
2222 | dev->vbi_dev = cx231xx_vdev_init(dev, &cx231xx_vbi_template, "vbi"); | 2199 | cx231xx_vdev_init(dev, &dev->vbi_dev, &cx231xx_vbi_template, "vbi"); |
2223 | 2200 | ||
2224 | if (!dev->vbi_dev) { | ||
2225 | dev_err(dev->dev, "cannot allocate video_device.\n"); | ||
2226 | return -ENODEV; | ||
2227 | } | ||
2228 | #if defined(CONFIG_MEDIA_CONTROLLER) | 2201 | #if defined(CONFIG_MEDIA_CONTROLLER) |
2229 | dev->vbi_pad.flags = MEDIA_PAD_FL_SINK; | 2202 | dev->vbi_pad.flags = MEDIA_PAD_FL_SINK; |
2230 | ret = media_entity_init(&dev->vbi_dev->entity, 1, &dev->vbi_pad, 0); | 2203 | ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad, 0); |
2231 | if (ret < 0) | 2204 | if (ret < 0) |
2232 | dev_err(dev->dev, "failed to initialize vbi media entity!\n"); | 2205 | dev_err(dev->dev, "failed to initialize vbi media entity!\n"); |
2233 | #endif | 2206 | #endif |
2234 | dev->vbi_dev->ctrl_handler = &dev->ctrl_handler; | 2207 | dev->vbi_dev.ctrl_handler = &dev->ctrl_handler; |
2235 | /* register v4l2 vbi video_device */ | 2208 | /* register v4l2 vbi video_device */ |
2236 | ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, | 2209 | ret = video_register_device(&dev->vbi_dev, VFL_TYPE_VBI, |
2237 | vbi_nr[dev->devno]); | 2210 | vbi_nr[dev->devno]); |
2238 | if (ret < 0) { | 2211 | if (ret < 0) { |
2239 | dev_err(dev->dev, "unable to register vbi device\n"); | 2212 | dev_err(dev->dev, "unable to register vbi device\n"); |
@@ -2241,18 +2214,13 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) | |||
2241 | } | 2214 | } |
2242 | 2215 | ||
2243 | dev_info(dev->dev, "Registered VBI device %s\n", | 2216 | dev_info(dev->dev, "Registered VBI device %s\n", |
2244 | video_device_node_name(dev->vbi_dev)); | 2217 | video_device_node_name(&dev->vbi_dev)); |
2245 | 2218 | ||
2246 | if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) { | 2219 | if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) { |
2247 | dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template, | 2220 | cx231xx_vdev_init(dev, &dev->radio_dev, |
2248 | "radio"); | 2221 | &cx231xx_radio_template, "radio"); |
2249 | if (!dev->radio_dev) { | 2222 | dev->radio_dev.ctrl_handler = &dev->radio_ctrl_handler; |
2250 | dev_err(dev->dev, | 2223 | ret = video_register_device(&dev->radio_dev, VFL_TYPE_RADIO, |
2251 | "cannot allocate video_device.\n"); | ||
2252 | return -ENODEV; | ||
2253 | } | ||
2254 | dev->radio_dev->ctrl_handler = &dev->radio_ctrl_handler; | ||
2255 | ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO, | ||
2256 | radio_nr[dev->devno]); | 2224 | radio_nr[dev->devno]); |
2257 | if (ret < 0) { | 2225 | if (ret < 0) { |
2258 | dev_err(dev->dev, | 2226 | dev_err(dev->dev, |
@@ -2260,7 +2228,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) | |||
2260 | return ret; | 2228 | return ret; |
2261 | } | 2229 | } |
2262 | dev_info(dev->dev, "Registered radio device as %s\n", | 2230 | dev_info(dev->dev, "Registered radio device as %s\n", |
2263 | video_device_node_name(dev->radio_dev)); | 2231 | video_device_node_name(&dev->radio_dev)); |
2264 | } | 2232 | } |
2265 | 2233 | ||
2266 | return 0; | 2234 | return 0; |
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h index 9871c79f88ff..00d3bce9a690 100644 --- a/drivers/media/usb/cx231xx/cx231xx.h +++ b/drivers/media/usb/cx231xx/cx231xx.h | |||
@@ -634,7 +634,7 @@ struct cx231xx { | |||
634 | 634 | ||
635 | /* video for linux */ | 635 | /* video for linux */ |
636 | int users; /* user count for exclusive use */ | 636 | int users; /* user count for exclusive use */ |
637 | struct video_device *vdev; /* video for linux device struct */ | 637 | struct video_device vdev; /* video for linux device struct */ |
638 | v4l2_std_id norm; /* selected tv norm */ | 638 | v4l2_std_id norm; /* selected tv norm */ |
639 | int ctl_freq; /* selected frequency */ | 639 | int ctl_freq; /* selected frequency */ |
640 | unsigned int ctl_ainput; /* selected audio input */ | 640 | unsigned int ctl_ainput; /* selected audio input */ |
@@ -656,8 +656,8 @@ struct cx231xx { | |||
656 | struct mutex ctrl_urb_lock; /* protects urb_buf */ | 656 | struct mutex ctrl_urb_lock; /* protects urb_buf */ |
657 | struct list_head inqueue, outqueue; | 657 | struct list_head inqueue, outqueue; |
658 | wait_queue_head_t open, wait_frame, wait_stream; | 658 | wait_queue_head_t open, wait_frame, wait_stream; |
659 | struct video_device *vbi_dev; | 659 | struct video_device vbi_dev; |
660 | struct video_device *radio_dev; | 660 | struct video_device radio_dev; |
661 | 661 | ||
662 | #if defined(CONFIG_MEDIA_CONTROLLER) | 662 | #if defined(CONFIG_MEDIA_CONTROLLER) |
663 | struct media_device *media_dev; | 663 | struct media_device *media_dev; |
@@ -724,7 +724,7 @@ struct cx231xx { | |||
724 | u8 USE_ISO; | 724 | u8 USE_ISO; |
725 | struct cx231xx_tvnorm encodernorm; | 725 | struct cx231xx_tvnorm encodernorm; |
726 | struct cx231xx_tsport ts1, ts2; | 726 | struct cx231xx_tsport ts1, ts2; |
727 | struct video_device *v4l_device; | 727 | struct video_device v4l_device; |
728 | atomic_t v4l_reader_count; | 728 | atomic_t v4l_reader_count; |
729 | u32 freq; | 729 | u32 freq; |
730 | unsigned int input; | 730 | unsigned int input; |