drm: ->agp_init can't fail
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 11 Dec 2013 10:34:34 +0000 (11:34 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 18 Dec 2013 01:18:12 +0000 (11:18 +1000)
Thanks to the removal of REQUIRE_AGP we can use a void return value
and shed a bit of complexity.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/drm_stub.c
include/drm/drmP.h

index c99c71b3d220d38e2dd602473d65d5734e5ea3b1..d3875e3f9d9c952a7bc51dde757871c0880a85d1 100644 (file)
@@ -262,7 +262,7 @@ static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
        return 0;
 }
 
-static int drm_pci_agp_init(struct drm_device *dev)
+static void drm_pci_agp_init(struct drm_device *dev)
 {
        if (drm_core_has_AGP(dev)) {
                if (drm_pci_device_is_agp(dev))
@@ -274,7 +274,6 @@ static int drm_pci_agp_init(struct drm_device *dev)
                                1024 * 1024);
                }
        }
-       return 0;
 }
 
 static void drm_pci_agp_destroy(struct drm_device *dev)
index 9de0d3d91cc6931dc11ed714d9ea94e915540e27..82141e6e8ac842fb73d8501ee2dac5eab9bdb053 100644 (file)
@@ -527,11 +527,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 
        mutex_lock(&drm_global_mutex);
 
-       if (dev->driver->bus->agp_init) {
-               ret = dev->driver->bus->agp_init(dev);
-               if (ret)
-                       goto out_unlock;
-       }
+       if (dev->driver->bus->agp_init)
+               dev->driver->bus->agp_init(dev);
 
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL);
index eef421bb7b9544443f3321f68da47712a2def0b4..04909a80735dd992a53ecb153bda0ae8ba0ccad1 100644 (file)
@@ -767,7 +767,7 @@ struct drm_bus {
                          struct drm_unique *unique);
        int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
        /* hooks that are for PCI */
-       int (*agp_init)(struct drm_device *dev);
+       void (*agp_init)(struct drm_device *dev);
        void (*agp_destroy)(struct drm_device *dev);
 
 };