Commit 5829d183 authored by Daniel Vetter's avatar Daniel Vetter

drm: rip out dev->devname

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: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 53bf2a2b
...@@ -72,9 +72,6 @@ static void ...@@ -72,9 +72,6 @@ static void
drm_unset_busid(struct drm_device *dev, drm_unset_busid(struct drm_device *dev,
struct drm_master *master) struct drm_master *master)
{ {
kfree(dev->devname);
dev->devname = NULL;
kfree(master->unique); kfree(master->unique);
master->unique = NULL; master->unique = NULL;
master->unique_len = 0; master->unique_len = 0;
......
...@@ -246,7 +246,6 @@ int drm_irq_install(struct drm_device *dev, int irq) ...@@ -246,7 +246,6 @@ int drm_irq_install(struct drm_device *dev, int irq)
{ {
int ret; int ret;
unsigned long sh_flags = 0; unsigned long sh_flags = 0;
char *irqname;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL; return -EINVAL;
...@@ -272,13 +271,8 @@ int drm_irq_install(struct drm_device *dev, int irq) ...@@ -272,13 +271,8 @@ int drm_irq_install(struct drm_device *dev, int irq)
if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
sh_flags = IRQF_SHARED; sh_flags = IRQF_SHARED;
if (dev->devname)
irqname = dev->devname;
else
irqname = dev->driver->name;
ret = request_irq(irq, dev->driver->irq_handler, ret = request_irq(irq, dev->driver->irq_handler,
sh_flags, irqname, dev); sh_flags, dev->driver->name, dev);
if (ret < 0) { if (ret < 0) {
dev->irq_enabled = false; dev->irq_enabled = false;
......
...@@ -146,7 +146,6 @@ static const char *drm_pci_get_name(struct drm_device *dev) ...@@ -146,7 +146,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) static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
{ {
int len, ret; int len, ret;
struct pci_driver *pdriver = dev->driver->kdriver.pci;
master->unique_len = 40; master->unique_len = 40;
master->unique_size = master->unique_len; master->unique_size = master->unique_len;
master->unique = kmalloc(master->unique_size, GFP_KERNEL); master->unique = kmalloc(master->unique_size, GFP_KERNEL);
...@@ -168,18 +167,6 @@ static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) ...@@ -168,18 +167,6 @@ static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
} else } else
master->unique_len = len; 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; return 0;
err: err:
return ret; return ret;
...@@ -190,7 +177,6 @@ int drm_pci_set_unique(struct drm_device *dev, ...@@ -190,7 +177,6 @@ int drm_pci_set_unique(struct drm_device *dev,
struct drm_unique *u) struct drm_unique *u)
{ {
int domain, bus, slot, func, ret; int domain, bus, slot, func, ret;
const char *bus_name;
master->unique_len = u->unique_len; master->unique_len = u->unique_len;
master->unique_size = u->unique_len + 1; master->unique_size = u->unique_len + 1;
...@@ -207,17 +193,6 @@ int drm_pci_set_unique(struct drm_device *dev, ...@@ -207,17 +193,6 @@ int drm_pci_set_unique(struct drm_device *dev,
master->unique[master->unique_len] = '\0'; 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 /* Return error if the busid submitted doesn't match the device's actual
* busid. * busid.
*/ */
......
...@@ -101,17 +101,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas ...@@ -101,17 +101,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas
goto err; 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; return 0;
err: err:
return ret; return ret;
......
...@@ -166,9 +166,6 @@ static void drm_master_destroy(struct kref *kref) ...@@ -166,9 +166,6 @@ static void drm_master_destroy(struct kref *kref)
master->unique_len = 0; master->unique_len = 0;
} }
kfree(dev->devname);
dev->devname = NULL;
list_for_each_entry_safe(pt, next, &master->magicfree, head) { list_for_each_entry_safe(pt, next, &master->magicfree, head) {
list_del(&pt->head); list_del(&pt->head);
drm_ht_remove_item(&master->magiclist, &pt->hash_item); drm_ht_remove_item(&master->magiclist, &pt->hash_item);
...@@ -648,8 +645,6 @@ static void drm_dev_release(struct kref *ref) ...@@ -648,8 +645,6 @@ static void drm_dev_release(struct kref *ref)
drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_RENDER);
drm_minor_free(dev, DRM_MINOR_CONTROL); drm_minor_free(dev, DRM_MINOR_CONTROL);
kfree(dev->devname);
mutex_destroy(&dev->master_mutex); mutex_destroy(&dev->master_mutex);
kfree(dev); kfree(dev);
} }
......
...@@ -12,9 +12,7 @@ static int drm_host1x_set_busid(struct drm_device *dev, ...@@ -12,9 +12,7 @@ static int drm_host1x_set_busid(struct drm_device *dev,
struct drm_master *master) struct drm_master *master)
{ {
const char *device = dev_name(dev->dev); const char *device = dev_name(dev->dev);
const char *driver = dev->driver->name;
const char *bus = dev->dev->bus->name; const char *bus = dev->dev->bus->name;
int length;
master->unique_len = strlen(bus) + 1 + strlen(device); master->unique_len = strlen(bus) + 1 + strlen(device);
master->unique_size = master->unique_len; master->unique_size = master->unique_len;
...@@ -25,14 +23,6 @@ static int drm_host1x_set_busid(struct drm_device *dev, ...@@ -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); 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; return 0;
} }
......
...@@ -1048,7 +1048,6 @@ struct drm_vblank_crtc { ...@@ -1048,7 +1048,6 @@ struct drm_vblank_crtc {
*/ */
struct drm_device { struct drm_device {
struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */ 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 */ int if_version; /**< Highest interface version set */
/** \name Lifetime Management */ /** \name Lifetime Management */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment