Skip to content

Commit

Permalink
drm: remove drm_bus->get_name
Browse files Browse the repository at this point in the history
The only user is the info debugfs file, so we only need something
human readable. Now for both pci and platform devices we've used the
name of the underlying device driver, which matches the name of the
drm driver in all cases. So we can just use that instead.

The exception is usb, which used a generic "USB". Not to harmful with
just one usb driver, but better to use "udl", too.

With that converted we can rip out all the ->get_name implementations.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Apr 23, 2014
1 parent 5829d18 commit 9de1b51
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 24 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/drm_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ int drm_name_info(struct seq_file *m, void *data)
struct drm_minor *minor = node->minor;
struct drm_device *dev = minor->dev;
struct drm_master *master = minor->master;
const char *bus_name;
if (!master)
return 0;

bus_name = dev->driver->bus->get_name(dev);
if (master->unique) {
seq_printf(m, "%s %s %s\n",
bus_name,
dev->driver->name,
dev_name(dev->dev), master->unique);
} else {
seq_printf(m, "%s %s\n",
bus_name, dev_name(dev->dev));
dev->driver->name, dev_name(dev->dev));
}
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/drm_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ static int drm_get_pci_domain(struct drm_device *dev)
return pci_domain_nr(dev->pdev->bus);
}

static const char *drm_pci_get_name(struct drm_device *dev)
{
struct pci_driver *pdriver = dev->driver->kdriver.pci;
return pdriver->name;
}

static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
{
int len, ret;
Expand Down Expand Up @@ -287,7 +281,6 @@ void drm_pci_agp_destroy(struct drm_device *dev)
}

static struct drm_bus drm_pci_bus = {
.get_name = drm_pci_get_name,
.set_busid = drm_pci_set_busid,
};

Expand Down
6 changes: 0 additions & 6 deletions drivers/gpu/drm/drm_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
return ret;
}

static const char *drm_platform_get_name(struct drm_device *dev)
{
return dev->platformdev->name;
}

static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *master)
{
int len, ret, id;
Expand Down Expand Up @@ -107,7 +102,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas
}

static struct drm_bus drm_platform_bus = {
.get_name = drm_platform_get_name,
.set_busid = drm_platform_set_busid,
};

Expand Down
6 changes: 0 additions & 6 deletions drivers/gpu/drm/drm_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,13 @@ int drm_get_usb_dev(struct usb_interface *interface,
}
EXPORT_SYMBOL(drm_get_usb_dev);

static const char *drm_usb_get_name(struct drm_device *dev)
{
return "USB";
}

static int drm_usb_set_busid(struct drm_device *dev,
struct drm_master *master)
{
return 0;
}

static struct drm_bus drm_usb_bus = {
.get_name = drm_usb_get_name,
.set_busid = drm_usb_set_busid,
};

Expand Down
1 change: 0 additions & 1 deletion include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ struct drm_master {
#define DRM_SCANOUTPOS_ACCURATE (1 << 2)

struct drm_bus {
const char *(*get_name)(struct drm_device *dev);
int (*set_busid)(struct drm_device *dev, struct drm_master *master);
};

Expand Down

0 comments on commit 9de1b51

Please sign in to comment.