All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 15/18] drm: rip out dev->devname
Date: Fri, 11 Apr 2014 23:36:12 +0200	[thread overview]
Message-ID: <1397252175-14227-16-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1397252175-14227-1-git-send-email-daniel.vetter@ffwll.ch>

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.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_ioctl.c    |  3 ---
 drivers/gpu/drm/drm_irq.c      |  8 +-------
 drivers/gpu/drm/drm_pci.c      | 25 -------------------------
 drivers/gpu/drm/drm_platform.c | 11 -----------
 drivers/gpu/drm/drm_stub.c     |  5 -----
 drivers/gpu/drm/tegra/bus.c    | 10 ----------
 include/drm/drmP.h             |  1 -
 7 files changed, 1 insertion(+), 62 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 5aea5b57ba4b..2dd3a6d8382b 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -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;
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 1259e3db6d62..dd695f9c2b89 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)
 {
 	int ret;
 	unsigned long sh_flags = 0;
-	char *irqname;
 
 	if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
 		return -EINVAL;
@@ -272,13 +271,8 @@ int drm_irq_install(struct drm_device *dev, int irq)
 	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(dev->irq, dev->driver->irq_handler,
-			  sh_flags, irqname, dev);
+			  sh_flags, dev->driver->name, dev);
 
 	if (ret < 0) {
 		dev->irq_enabled = false;
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 0fa42072262b..da86ef8d531a 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)
 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);
@@ -168,18 +167,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;
@@ -190,7 +177,6 @@ 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;
@@ -207,17 +193,6 @@ 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.
 	 */
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
 		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;
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)
 		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);
@@ -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_CONTROL);
 
-	kfree(dev->devname);
-
 	mutex_destroy(&dev->master_mutex);
 	kfree(dev);
 }
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,
 				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;
 }
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 5333659d4d0e..9d8c690732cf 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1048,7 +1048,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 Lifetime Management */
-- 
1.8.5.2

  parent reply	other threads:[~2014-04-11 21:36 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 21:35 [PATCH 00/18] drm_bus cleanups and other cruft removal Daniel Vetter
2014-04-11 21:35 ` [PATCH 01/18] drm/omap: fix up pdev_remove Daniel Vetter
2014-04-12 15:26   ` Rob Clark
2014-04-14  6:26   ` Tomi Valkeinen
2014-04-16  8:15     ` Daniel Vetter
2014-04-16  8:27       ` Tomi Valkeinen
2014-04-16 17:05         ` Daniel Vetter
2014-04-11 21:35 ` [PATCH 02/18] drm/irq: simplify irq checks in drm_wait_vblank Daniel Vetter
2014-04-14 20:55   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 03/18] drm/pci: fold in irq_by_busid support Daniel Vetter
2014-04-17 14:33   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 04/18] drm/irq: drm_control is a legacy ioctl, so pci devices only Daniel Vetter
2014-04-17 14:38   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 05/18] drm/irq: remove cargo-culted locking from irq_install/unistall Daniel Vetter
2014-04-17 14:43   ` Thierry Reding
2014-04-17 14:44     ` Thierry Reding
2014-04-11 21:36 ` [PATCH 06/18] drm: remove drm_dev_to_irq from drivers Daniel Vetter
2014-04-17 14:47   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 07/18] drm: kill drm_bus->bus_type Daniel Vetter
2014-04-17 14:50   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 08/18] drm: Rip out totally bogus vga_switcheroo->can_switch locking Daniel Vetter
2014-04-17 14:56   ` Thierry Reding
2014-04-22 20:45     ` [PATCH] " Daniel Vetter
2014-04-23  7:28       ` Thierry Reding
2014-04-11 21:36 ` [PATCH 09/18] drm: rename dev->count_lock to dev->buf_lock Daniel Vetter
2014-04-17 14:57   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 10/18] drm/irq: track the irq installed in drm_irq_install in dev->irq Daniel Vetter
2014-04-16 21:57   ` Laurent Pinchart
2014-04-16 22:02   ` Laurent Pinchart
2014-04-22  9:46     ` Daniel Vetter
2014-04-22 10:49       ` Thierry Reding
2014-04-17 15:03   ` Thierry Reding
2014-04-22 20:44   ` [PATCH] " Daniel Vetter
2014-04-23  7:27     ` Thierry Reding
2014-04-23  8:31       ` Daniel Vetter
2014-04-11 21:36 ` [PATCH 11/18] drm/irq: Look up the pci irq directly in the drm_control ioctl Daniel Vetter
2014-04-11 21:36 ` [PATCH 12/18] drm: pass the irq explicitly to drm_irq_install Daniel Vetter
2014-04-17 15:06   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 13/18] drm: remove bus->get_irq implementations Daniel Vetter
2014-04-17 15:07   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 14/18] drm: inline drm_pci_set_unique Daniel Vetter
2014-04-17 15:10   ` Thierry Reding
2014-04-11 21:36 ` Daniel Vetter [this message]
2014-04-17 15:11   ` [PATCH 15/18] drm: rip out dev->devname Thierry Reding
2014-04-11 21:36 ` [PATCH 16/18] drm: remove drm_bus->get_name Daniel Vetter
2014-04-17 15:12   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 17/18] drm: Remove dev->kdriver Daniel Vetter
2014-04-17 15:13   ` Thierry Reding
2014-04-11 21:36 ` [PATCH 18/18] drm/<drivers>: don't set driver->dev_priv_size to 0 Daniel Vetter
2014-04-17 15:14   ` Thierry Reding
2014-04-16 22:10 ` [PATCH 00/18] drm_bus cleanups and other cruft removal Laurent Pinchart
2014-04-22  7:30 ` David Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397252175-14227-16-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.