drm: rip out dev->devname
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 3 Nov 2013 20:48:48 +0000 (21:48 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Thu, 11 Dec 2014 01:28:13 +0000 (10:28 +0900)
This was only ever used to pretty-print the irq driver name. And on
kms systems due to set_version bonghits we never set up the prettier
name, ever. Which make this a bit pointless.

Also, we can always dig out the driver-instance/irq relationship
through other means, so this isn't that useful. So just rip it out to
simplify the set_version/set_busid insanity a bit.

Also delete the temporary busname from drm_pci_set_busid, it's now
unused.

v2: Rebase on top of the new host1x drm_bus for tegra.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 5829d1834e5486e83547f36576b160023c9609c2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
drivers/gpu/drm/drm_stub.c

drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/drm_platform.c
drivers/gpu/drm/drm_stub.c
drivers/gpu/drm/tegra/bus.c
include/drm/drmP.h

index f4dc9b7..89ba74b 100644 (file)
@@ -72,9 +72,6 @@ static void
 drm_unset_busid(struct drm_device *dev,
                struct drm_master *master)
 {
-       kfree(dev->devname);
-       dev->devname = NULL;
-
        kfree(master->unique);
        master->unique = NULL;
        master->unique_len = 0;
index 2c00b01..0d57128 100644 (file)
@@ -273,7 +273,6 @@ int drm_irq_install(struct drm_device *dev)
 {
        int ret, irq;
        unsigned long sh_flags = 0;
-       char *irqname;
 
        irq = drm_dev_to_irq(dev);
 
@@ -308,13 +307,8 @@ int drm_irq_install(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
                sh_flags = IRQF_SHARED;
 
-       if (dev->devname)
-               irqname = dev->devname;
-       else
-               irqname = dev->driver->name;
-
        ret = request_irq(irq, dev->driver->irq_handler,
-                         sh_flags, irqname, dev);
+                         sh_flags, dev->driver->name, dev);
 
        if (ret < 0) {
                mutex_lock(&dev->struct_mutex);
index f7af69b..40b8e2d 100644 (file)
@@ -151,7 +151,6 @@ static const char *drm_pci_get_name(struct drm_device *dev)
 static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
 {
        int len, ret;
-       struct pci_driver *pdriver = dev->driver->kdriver.pci;
        master->unique_len = 40;
        master->unique_size = master->unique_len;
        master->unique = kmalloc(master->unique_size, GFP_KERNEL);
@@ -173,18 +172,6 @@ static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
        } else
                master->unique_len = len;
 
-       dev->devname =
-               kmalloc(strlen(pdriver->name) +
-                       master->unique_len + 2, GFP_KERNEL);
-
-       if (dev->devname == NULL) {
-               ret = -ENOMEM;
-               goto err;
-       }
-
-       sprintf(dev->devname, "%s@%s", pdriver->name,
-               master->unique);
-
        return 0;
 err:
        return ret;
@@ -195,7 +182,6 @@ static int drm_pci_set_unique(struct drm_device *dev,
                              struct drm_unique *u)
 {
        int domain, bus, slot, func, ret;
-       const char *bus_name;
 
        master->unique_len = u->unique_len;
        master->unique_size = u->unique_len + 1;
@@ -212,17 +198,6 @@ static int drm_pci_set_unique(struct drm_device *dev,
 
        master->unique[master->unique_len] = '\0';
 
-       bus_name = dev->driver->bus->get_name(dev);
-       dev->devname = kmalloc(strlen(bus_name) +
-                              strlen(master->unique) + 2, GFP_KERNEL);
-       if (!dev->devname) {
-               ret = -ENOMEM;
-               goto err;
-       }
-
-       sprintf(dev->devname, "%s@%s", bus_name,
-               master->unique);
-
        /* Return error if the busid submitted doesn't match the device's actual
         * busid.
         */
index 21fc820..aacd42b 100644 (file)
@@ -106,17 +106,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas
                goto err;
        }
 
-       dev->devname =
-               kmalloc(strlen(dev->platformdev->name) +
-                       master->unique_len + 2, GFP_KERNEL);
-
-       if (dev->devname == NULL) {
-               ret = -ENOMEM;
-               goto err;
-       }
-
-       sprintf(dev->devname, "%s@%s", dev->platformdev->name,
-               master->unique);
        return 0;
 err:
        return ret;
index 5046180..fb3cb57 100644 (file)
@@ -186,9 +186,6 @@ static void drm_master_destroy(struct kref *kref)
                master->unique_len = 0;
        }
 
-       kfree(dev->devname);
-       dev->devname = NULL;
-
        list_for_each_entry_safe(pt, next, &master->magicfree, head) {
                list_del(&pt->head);
                drm_ht_remove_item(&master->magiclist, &pt->hash_item);
@@ -595,8 +592,6 @@ void drm_dev_free(struct drm_device *dev)
        drm_ht_remove(&dev->map_hash);
        drm_fs_inode_free(dev->anon_inode);
 
-       kfree(dev->devname);
-
        mutex_destroy(&dev->master_mutex);
        kfree(dev);
 }
index e38e596..7c9058f 100644 (file)
@@ -12,9 +12,7 @@ static int drm_host1x_set_busid(struct drm_device *dev,
                                struct drm_master *master)
 {
        const char *device = dev_name(dev->dev);
-       const char *driver = dev->driver->name;
        const char *bus = dev->dev->bus->name;
-       int length;
 
        master->unique_len = strlen(bus) + 1 + strlen(device);
        master->unique_size = master->unique_len;
@@ -25,14 +23,6 @@ static int drm_host1x_set_busid(struct drm_device *dev,
 
        snprintf(master->unique, master->unique_len + 1, "%s:%s", bus, device);
 
-       length = strlen(driver) + 1 + master->unique_len;
-
-       dev->devname = kmalloc(length + 1, GFP_KERNEL);
-       if (!dev->devname)
-               return -ENOMEM;
-
-       snprintf(dev->devname, length + 1, "%s@%s", driver, master->unique);
-
        return 0;
 }
 
index bcc9a7d..7f9a1b0 100644 (file)
@@ -1096,7 +1096,6 @@ struct drm_vblank_crtc {
  */
 struct drm_device {
        struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */
-       char *devname;                  /**< For /proc/interrupts */
        int if_version;                 /**< Highest interface version set */
 
        /** \name Locks */