drm: Deduplicate driver initialization message
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>
Wed, 28 Dec 2016 14:32:11 +0000 (12:32 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 30 Dec 2016 11:37:39 +0000 (12:37 +0100)
Several DRM drivers print the same initialization message right after
drm_dev_register, so move that to common code.  The exception is i915,
which uses its own register handle, so let it keep its own message.

Notice that this was tested only with Exynos, but looks simple enough
for the other drivers.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161228143216.26821-2-krisman@collabora.co.uk
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/drm_platform.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/virtio/virtgpu_drm_bus.c

index 07086b427c22ea76ac26ddf45efb38369b7f59a4..63f42d001f33d9ac1737d358c21ccdb4184083ff 100644 (file)
@@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
        armada_drm_debugfs_init(priv->drm.primary);
 #endif
 
-       DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
-                armada_drm_driver.name, armada_drm_driver.major,
-                armada_drm_driver.minor, armada_drm_driver.patchlevel,
-                armada_drm_driver.date, dev_name(dev),
-                priv->drm.primary->index);
-
        return 0;
 
  err_poll:
index bf3df4e4fdcec527be5464df8429782b1b1fbb4a..9d2b4b630601bf4c7a2afae5689d13853dc5e8a7 100644 (file)
@@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
  */
 int drm_dev_register(struct drm_device *dev, unsigned long flags)
 {
+       struct drm_driver *driver = dev->driver;
        int ret;
 
        mutex_lock(&drm_global_mutex);
@@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
                drm_modeset_register_all(dev);
 
        ret = 0;
+
+       DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
+                driver->name, driver->major, driver->minor,
+                driver->patchlevel, driver->date, dev_name(dev->dev),
+                dev->primary->index);
+
        goto out_unlock;
 
 err_minors:
index 3ceea9cb9d3e42a36f2811b2bea31d63445e4e42..dc358f860aeafea55a0289ee3d52ec6ef54af277 100644 (file)
@@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
        if (ret)
                goto err_agp;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
-                driver->name, driver->major, driver->minor, driver->patchlevel,
-                driver->date, pci_name(pdev), dev->primary->index);
-
        /* No locking needed since shadow-attach is single-threaded since it may
         * only be called from the per-driver module init hook. */
        if (drm_core_check_feature(dev, DRIVER_LEGACY))
index 026269851ce9f005e9eca687b2f9146e75bdf4f0..7af3005a030ceb62e35038eccf41f3bb815d183a 100644 (file)
@@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
        if (ret)
                goto err_free;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
-                driver->name, driver->major, driver->minor, driver->patchlevel,
-                driver->date, dev->primary->index);
-
        return 0;
 
 err_free:
index 0b35da73c2b0d6975e10c28db218bc5ef2bdd1fa..9a31711d51584c55730f5f29e177935bddc7b041 100644 (file)
@@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
        if (ret < 0)
                goto unref;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-                driver->major, driver->minor, driver->patchlevel,
-                driver->date, drm->primary->index);
-
        return 0;
 
 unref:
index fa228b7b022cfa484d19049b975f2f46446fa32c..7df0e8535e414e0ac072e3d33bf98f679239917e 100644 (file)
@@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
        if (ret)
                goto err_kms_cleanup;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
-                driver->name, driver->major, driver->minor, driver->patchlevel,
-                driver->date, drm_dev->primary->index);
-
        return 0;
 
 err_kms_cleanup:
index 4d966cddcc7167a0446703b12760b82bd0909af2..2817f43f334444f87e865ebdcbfe57de077eefe7 100644 (file)
@@ -995,10 +995,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
        if (err < 0)
                goto unref;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-                driver->major, driver->minor, driver->patchlevel,
-                driver->date, drm->primary->index);
-
        return 0;
 
 unref:
index 3b97d50fd3926b325a3d97b5905311e8a5f24408..43e1d5916c6c6e0eb388e4397244c94d6bdfb96d 100644 (file)
@@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
        if (ret)
                goto err_free;
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-                driver->major, driver->minor, driver->patchlevel,
-                driver->date, dev->primary->index);
-
        return 0;
 
 err_free: