drm/hisilicon: fix build error without fbdev emulation
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Jul 2017 18:05:31 +0000 (20:05 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 26 Jul 2017 11:45:09 +0000 (13:45 +0200)
We cannot reference priv->fbdev outside of the #ifdef:

drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function]
 static int virtnet_restore_up(struct virtio_device *vdev)
drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function]
 static void virtnet_freeze_down(struct virtio_device *vdev)

As the #ifdef is a bit annoying here, this removes it entirely
and uses an IS_ENABLED() check in it place where needed.

Fixes: b4dd9f1ffaba ("drm/hisilicon: Remove custom FB helper deferred setup")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[danvet: One step further, also remove the IS_ENABLED checks, core
no-ops out the fb helper functions that the cma helpers use. Discussed
with Arnd on dri-devel.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170725180555.3699056-1-arnd@arndb.de
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h

index 1178341c38580e439fcb8664ad9bb636c2d394e4..79fcce76f2ad5437a1c65b366d8c0b2a01a3ff4f 100644 (file)
@@ -34,12 +34,11 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
 {
        struct kirin_drm_private *priv = dev->dev_private;
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
        if (priv->fbdev) {
                drm_fbdev_cma_fini(priv->fbdev);
                priv->fbdev = NULL;
        }
-#endif
+
        drm_kms_helper_poll_fini(dev);
        dc_ops->cleanup(to_platform_device(dev->dev));
        drm_mode_config_cleanup(dev);
@@ -49,20 +48,16 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
 static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
 {
        struct kirin_drm_private *priv = dev->dev_private;
 
        drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
-#endif
 
 static const struct drm_mode_config_funcs kirin_drm_mode_config_funcs = {
        .fb_create = drm_fb_cma_create,
-#ifdef CONFIG_DRM_FBDEV_EMULATION
        .output_poll_changed = kirin_fbdev_output_poll_changed,
-#endif
        .atomic_check = drm_atomic_helper_check,
        .atomic_commit = drm_atomic_helper_commit,
 };
@@ -123,12 +118,12 @@ static int kirin_drm_kms_init(struct drm_device *dev)
 
        priv->fbdev = drm_fbdev_cma_init(dev, 32,
                                         dev->mode_config.num_connector);
+
        if (IS_ERR(priv->fbdev)) {
                DRM_ERROR("failed to initialize fbdev.\n");
                ret = PTR_ERR(priv->fbdev);
                goto err_cleanup_poll;
        }
-
        return 0;
 
 err_cleanup_poll:
index 7f60c64915d953563155de418764c74951f5bbb6..56cb62df065cfbfc9245bc876c3e0e38b301b7c7 100644 (file)
@@ -20,9 +20,7 @@ struct kirin_dc_ops {
 };
 
 struct kirin_drm_private {
-#ifdef CONFIG_DRM_FBDEV_EMULATION
        struct drm_fbdev_cma *fbdev;
-#endif
 };
 
 extern const struct kirin_dc_ops ade_dc_ops;