aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-03 15:48:48 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-23 04:32:52 -0400
commit5829d1834e5486e83547f36576b160023c9609c2 (patch)
tree0c8adba7b179e4bd5336e434d1661a2202858624
parent53bf2a2bca9b56e23fa8862159c75868672d7f1e (diff)
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: Thierry Reding <treding@nvidia.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_ioctl.c3
-rw-r--r--drivers/gpu/drm/drm_irq.c8
-rw-r--r--drivers/gpu/drm/drm_pci.c25
-rw-r--r--drivers/gpu/drm/drm_platform.c11
-rw-r--r--drivers/gpu/drm/drm_stub.c5
-rw-r--r--drivers/gpu/drm/tegra/bus.c10
-rw-r--r--include/drm/drmP.h1
7 files changed, 1 insertions, 62 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 53560ef53f99..38269d5aa333 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -72,9 +72,6 @@ static void
72drm_unset_busid(struct drm_device *dev, 72drm_unset_busid(struct drm_device *dev,
73 struct drm_master *master) 73 struct drm_master *master)
74{ 74{
75 kfree(dev->devname);
76 dev->devname = NULL;
77
78 kfree(master->unique); 75 kfree(master->unique);
79 master->unique = NULL; 76 master->unique = NULL;
80 master->unique_len = 0; 77 master->unique_len = 0;
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index de38bc9b6581..7583767ec619 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -246,7 +246,6 @@ int drm_irq_install(struct drm_device *dev, int irq)
246{ 246{
247 int ret; 247 int ret;
248 unsigned long sh_flags = 0; 248 unsigned long sh_flags = 0;
249 char *irqname;
250 249
251 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) 250 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
252 return -EINVAL; 251 return -EINVAL;
@@ -272,13 +271,8 @@ int drm_irq_install(struct drm_device *dev, int irq)
272 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) 271 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
273 sh_flags = IRQF_SHARED; 272 sh_flags = IRQF_SHARED;
274 273
275 if (dev->devname)
276 irqname = dev->devname;
277 else
278 irqname = dev->driver->name;
279
280 ret = request_irq(irq, dev->driver->irq_handler, 274 ret = request_irq(irq, dev->driver->irq_handler,
281 sh_flags, irqname, dev); 275 sh_flags, dev->driver->name, dev);
282 276
283 if (ret < 0) { 277 if (ret < 0) {
284 dev->irq_enabled = false; 278 dev->irq_enabled = false;
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index c550b349f202..047c51046d94 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -146,7 +146,6 @@ static const char *drm_pci_get_name(struct drm_device *dev)
146static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) 146static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
147{ 147{
148 int len, ret; 148 int len, ret;
149 struct pci_driver *pdriver = dev->driver->kdriver.pci;
150 master->unique_len = 40; 149 master->unique_len = 40;
151 master->unique_size = master->unique_len; 150 master->unique_size = master->unique_len;
152 master->unique = kmalloc(master->unique_size, GFP_KERNEL); 151 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 } else 167 } else
169 master->unique_len = len; 168 master->unique_len = len;
170 169
171 dev->devname =
172 kmalloc(strlen(pdriver->name) +
173 master->unique_len + 2, GFP_KERNEL);
174
175 if (dev->devname == NULL) {
176 ret = -ENOMEM;
177 goto err;
178 }
179
180 sprintf(dev->devname, "%s@%s", pdriver->name,
181 master->unique);
182
183 return 0; 170 return 0;
184err: 171err:
185 return ret; 172 return ret;
@@ -190,7 +177,6 @@ int drm_pci_set_unique(struct drm_device *dev,
190 struct drm_unique *u) 177 struct drm_unique *u)
191{ 178{
192 int domain, bus, slot, func, ret; 179 int domain, bus, slot, func, ret;
193 const char *bus_name;
194 180
195 master->unique_len = u->unique_len; 181 master->unique_len = u->unique_len;
196 master->unique_size = u->unique_len + 1; 182 master->unique_size = u->unique_len + 1;
@@ -207,17 +193,6 @@ int drm_pci_set_unique(struct drm_device *dev,
207 193
208 master->unique[master->unique_len] = '\0'; 194 master->unique[master->unique_len] = '\0';
209 195
210 bus_name = dev->driver->bus->get_name(dev);
211 dev->devname = kmalloc(strlen(bus_name) +
212 strlen(master->unique) + 2, GFP_KERNEL);
213 if (!dev->devname) {
214 ret = -ENOMEM;
215 goto err;
216 }
217
218 sprintf(dev->devname, "%s@%s", bus_name,
219 master->unique);
220
221 /* Return error if the busid submitted doesn't match the device's actual 196 /* Return error if the busid submitted doesn't match the device's actual
222 * busid. 197 * busid.
223 */ 198 */
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index 5b918212b1c3..b97b11ea2dc4 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -101,17 +101,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas
101 goto err; 101 goto err;
102 } 102 }
103 103
104 dev->devname =
105 kmalloc(strlen(dev->platformdev->name) +
106 master->unique_len + 2, GFP_KERNEL);
107
108 if (dev->devname == NULL) {
109 ret = -ENOMEM;
110 goto err;
111 }
112
113 sprintf(dev->devname, "%s@%s", dev->platformdev->name,
114 master->unique);
115 return 0; 104 return 0;
116err: 105err:
117 return ret; 106 return ret;
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 5394b201c3d0..3a8e832ad151 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -166,9 +166,6 @@ static void drm_master_destroy(struct kref *kref)
166 master->unique_len = 0; 166 master->unique_len = 0;
167 } 167 }
168 168
169 kfree(dev->devname);
170 dev->devname = NULL;
171
172 list_for_each_entry_safe(pt, next, &master->magicfree, head) { 169 list_for_each_entry_safe(pt, next, &master->magicfree, head) {
173 list_del(&pt->head); 170 list_del(&pt->head);
174 drm_ht_remove_item(&master->magiclist, &pt->hash_item); 171 drm_ht_remove_item(&master->magiclist, &pt->hash_item);
@@ -648,8 +645,6 @@ static void drm_dev_release(struct kref *ref)
648 drm_minor_free(dev, DRM_MINOR_RENDER); 645 drm_minor_free(dev, DRM_MINOR_RENDER);
649 drm_minor_free(dev, DRM_MINOR_CONTROL); 646 drm_minor_free(dev, DRM_MINOR_CONTROL);
650 647
651 kfree(dev->devname);
652
653 mutex_destroy(&dev->master_mutex); 648 mutex_destroy(&dev->master_mutex);
654 kfree(dev); 649 kfree(dev);
655} 650}
diff --git a/drivers/gpu/drm/tegra/bus.c b/drivers/gpu/drm/tegra/bus.c
index 6916fa51cfa4..b3a66d65cb53 100644
--- a/drivers/gpu/drm/tegra/bus.c
+++ b/drivers/gpu/drm/tegra/bus.c
@@ -12,9 +12,7 @@ static int drm_host1x_set_busid(struct drm_device *dev,
12 struct drm_master *master) 12 struct drm_master *master)
13{ 13{
14 const char *device = dev_name(dev->dev); 14 const char *device = dev_name(dev->dev);
15 const char *driver = dev->driver->name;
16 const char *bus = dev->dev->bus->name; 15 const char *bus = dev->dev->bus->name;
17 int length;
18 16
19 master->unique_len = strlen(bus) + 1 + strlen(device); 17 master->unique_len = strlen(bus) + 1 + strlen(device);
20 master->unique_size = master->unique_len; 18 master->unique_size = master->unique_len;
@@ -25,14 +23,6 @@ static int drm_host1x_set_busid(struct drm_device *dev,
25 23
26 snprintf(master->unique, master->unique_len + 1, "%s:%s", bus, device); 24 snprintf(master->unique, master->unique_len + 1, "%s:%s", bus, device);
27 25
28 length = strlen(driver) + 1 + master->unique_len;
29
30 dev->devname = kmalloc(length + 1, GFP_KERNEL);
31 if (!dev->devname)
32 return -ENOMEM;
33
34 snprintf(dev->devname, length + 1, "%s@%s", driver, master->unique);
35
36 return 0; 26 return 0;
37} 27}
38 28
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1a9d509bef66..56b028d6bc98 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1048,7 +1048,6 @@ struct drm_vblank_crtc {
1048 */ 1048 */
1049struct drm_device { 1049struct drm_device {
1050 struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */ 1050 struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */
1051 char *devname; /**< For /proc/interrupts */
1052 int if_version; /**< Highest interface version set */ 1051 int if_version; /**< Highest interface version set */
1053 1052
1054 /** \name Lifetime Management */ 1053 /** \name Lifetime Management */