Skip to content

Commit

Permalink
drm: fix irq naming for kms drivers.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Airlie committed Jun 3, 2009
1 parent 9fa7eb2 commit b8da7de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 2 additions & 10 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b8da7de

Please sign in to comment.