diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2016-06-06 15:23:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-15 19:17:04 +0200 |
commit | 323977d5d33a8dff63193f2c68a2aff001e9b68f (patch) | |
tree | c39feca73251f881a6957fc3dac6a69977741a0d /drivers/staging/most/aim-v4l2 | |
parent | db5a48d595cfd27ba66625558d982205b46d11fd (diff) |
staging: most: v4l2-aim: assign unique names to devices
The current V4L2 AIM implementation assigns to all video devices and to
all V4L devices the same names.
This patch makes use of hardware dependent names for the video devices and
allows the user to choose the names for the V4L devices.
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/aim-v4l2')
-rw-r--r-- | drivers/staging/most/aim-v4l2/video.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/most/aim-v4l2/video.c b/drivers/staging/most/aim-v4l2/video.c index 6b7e220a4c1b..9a383e04b9d5 100644 --- a/drivers/staging/most/aim-v4l2/video.c +++ b/drivers/staging/most/aim-v4l2/video.c @@ -259,7 +259,7 @@ static int vidioc_querycap(struct file *file, void *priv, pr_info("vidioc_querycap()\n"); strlcpy(cap->driver, "v4l2_most_aim", sizeof(cap->driver)); - strlcpy(cap->card, "my_card", sizeof(cap->card)); + strlcpy(cap->card, "MOST", sizeof(cap->card)); snprintf(cap->bus_info, sizeof(cap->bus_info), "%s", mdev->iface->description); @@ -446,7 +446,8 @@ static int aim_register_videodev(struct most_video_dev *mdev) *mdev->vdev = aim_videodev_template; mdev->vdev->v4l2_dev = &mdev->v4l2_dev; mdev->vdev->lock = &mdev->lock; - strcpy(mdev->vdev->name, "most v4l2 aim video"); + snprintf(mdev->vdev->name, sizeof(mdev->vdev->name), "MOST: %s", + mdev->v4l2_dev.name); /* Register the v4l2 device */ video_set_drvdata(mdev->vdev, mdev); @@ -518,8 +519,7 @@ static int aim_probe_channel(struct most_interface *iface, int channel_idx, mdev->v4l2_dev.release = aim_v4l2_dev_release; /* Create the v4l2_device */ - strlcpy(mdev->v4l2_dev.name, "most_video_device", - sizeof(mdev->v4l2_dev.name)); + strlcpy(mdev->v4l2_dev.name, name, sizeof(mdev->v4l2_dev.name)); ret = v4l2_device_register(NULL, &mdev->v4l2_dev); if (ret) { pr_err("v4l2_device_register() failed\n"); |