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: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2009-06-02 16:50:35 +10:00
parent 9fa7eb283c
commit b8da7de56c
2 changed files with 9 additions and 11 deletions

View file

@ -196,6 +196,7 @@ int drm_irq_install(struct drm_device *dev)
{ {
int ret = 0; int ret = 0;
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;
@ -227,8 +228,13 @@ int drm_irq_install(struct drm_device *dev)
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(drm_dev_to_irq(dev), dev->driver->irq_handler, ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
sh_flags, dev->devname, dev); sh_flags, irqname, dev);
if (ret < 0) { if (ret < 0) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);

View file

@ -987,12 +987,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
int fb_bar = IS_I9XX(dev) ? 2 : 0; int fb_bar = IS_I9XX(dev) ? 2 : 0;
int ret = 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) & dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
0xff000000; 0xff000000;
@ -1006,7 +1000,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
ret = i915_probe_agp(dev, &agp_size, &prealloc_size); ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
if (ret) if (ret)
goto kfree_devname; goto out;
/* Basic memrange allocator for stolen space (aka vram) */ /* Basic memrange allocator for stolen space (aka vram) */
drm_mm_init(&dev_priv->vram, 0, prealloc_size); 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); ret = i915_gem_init_ringbuffer(dev);
if (ret) if (ret)
goto kfree_devname; goto out;
/* Allow hardware batchbuffers unless told otherwise. /* Allow hardware batchbuffers unless told otherwise.
*/ */
@ -1056,8 +1050,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
destroy_ringbuffer: destroy_ringbuffer:
i915_gem_cleanup_ringbuffer(dev); i915_gem_cleanup_ringbuffer(dev);
kfree_devname:
kfree(dev->devname);
out: out:
return ret; return ret;
} }