[media] exynos4-is: Fix driver name reported in vidioc_querycap

Originally struct v4l2_capability driver and card name was filled
with name of the platform device. After switching to the device tree
the device names have changed and now are 4 different driver names
reported, depending on the video device opened. So instead of e.g.
"exynos4-fimc" there is now one of: 11800000.fimc, 11810000.fimc,
11820000.fimc, 11830000.fimc.
Fix this by using dev->driver_name, rather than platform device name.
A common vidioc_querycap function is created for both M2M and capture
video node.
This fixes any breakage at user space should any application/library
rely on the driver's name.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c
index a8eaad0..379a5e9 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -213,6 +213,17 @@
 	return &fimc_formats[index];
 }
 
+void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap,
+						unsigned int caps)
+{
+	strlcpy(cap->driver, dev->driver->name, sizeof(cap->driver));
+	strlcpy(cap->card, dev->driver->name, sizeof(cap->card));
+	snprintf(cap->bus_info, sizeof(cap->bus_info),
+				"platform:%s", dev_name(dev));
+	cap->device_caps = caps;
+	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
+}
+
 int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
 			    int dw, int dh, int rotation)
 {
@@ -1283,7 +1294,7 @@
 	.id_table	= fimc_driver_ids,
 	.driver = {
 		.of_match_table = fimc_of_match,
-		.name		= FIMC_MODULE_NAME,
+		.name		= FIMC_DRIVER_NAME,
 		.owner		= THIS_MODULE,
 		.pm     	= &fimc_pm_ops,
 	}