summaryrefslogtreecommitdiff
path: root/drivers/media/usb/siano/smsusb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-16 08:07:43 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-16 09:30:46 -0200
commit3d0ccad0dbbd51b64d307c64cc163002334afbfa (patch)
treea5ec61523a5c8ec46a8639781e01024f6eab89f2 /drivers/media/usb/siano/smsusb.c
parentdd47fbd40e6ea6884e295e13a2e50b0894258fdf (diff)
[media] siano: use generic function to create MC device
Currently, it is initializing the driver name using the wrong name ("usb"). Use the generic function, as its logic works best, and avoids repeating the very same code everywhere. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/siano/smsusb.c')
-rw-r--r--drivers/media/usb/siano/smsusb.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 9fac9779f616..4dac499ed28e 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/module.h>
+#include <media/v4l2-mc.h>
#include "sms-cards.h"
#include "smsendian.h"
@@ -366,20 +367,10 @@ static void *siano_media_device_register(struct smsusb_device_t *dev,
struct sms_board *board = sms_get_board(board_id);
int ret;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = v4l2_mc_usb_media_device_init(udev, board->name);
if (!mdev)
return NULL;
- mdev->dev = &udev->dev;
- strlcpy(mdev->model, board->name, sizeof(mdev->model));
- if (udev->serial)
- strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
- strcpy(mdev->bus_info, udev->devpath);
- mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
- mdev->driver_version = LINUX_VERSION_CODE;
-
- media_device_init(mdev);
-
ret = media_device_register(mdev);
if (ret) {
media_device_cleanup(mdev);