Commit b8da7de5 authored by Dave Airlie's avatar Dave Airlie

drm: fix irq naming for kms drivers.

allocating devname in the i915 driver was a hack originally and I
forgot to figure out how to do this properly back then.

So this is the cleaner version that just picks devname or driver name
in the irq code.

It removes the devname allocs from the i915 driver.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 9fa7eb28
......@@ -196,6 +196,7 @@ int drm_irq_install(struct drm_device *dev)
{
int ret = 0;
unsigned long sh_flags = 0;
char *irqname;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
......@@ -227,8 +228,13 @@ 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(drm_dev_to_irq(dev), dev->driver->irq_handler,
sh_flags, dev->devname, dev);
sh_flags, irqname, dev);
if (ret < 0) {
mutex_lock(&dev->struct_mutex);
......
......@@ -987,12 +987,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
int fb_bar = IS_I9XX(dev) ? 2 : 0;
int ret = 0;
dev->devname = kstrdup(DRIVER_NAME, GFP_KERNEL);
if (!dev->devname) {
ret = -ENOMEM;
goto out;
}
dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
0xff000000;
......@@ -1006,7 +1000,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
if (ret)
goto kfree_devname;
goto out;
/* Basic memrange allocator for stolen space (aka vram) */
drm_mm_init(&dev_priv->vram, 0, prealloc_size);
......@@ -1024,7 +1018,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
ret = i915_gem_init_ringbuffer(dev);
if (ret)
goto kfree_devname;
goto out;
/* Allow hardware batchbuffers unless told otherwise.
*/
......@@ -1056,8 +1050,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
destroy_ringbuffer:
i915_gem_cleanup_ringbuffer(dev);
kfree_devname:
kfree(dev->devname);
out:
return ret;
}
......
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