From patchwork Tue Jul 25 18:05:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9862639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1145601A1 for ; Tue, 25 Jul 2017 18:06:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8C812871C for ; Tue, 25 Jul 2017 18:06:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD3602871B; Tue, 25 Jul 2017 18:06:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4B40B28714 for ; Tue, 25 Jul 2017 18:06:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 322E96E0C6; Tue, 25 Jul 2017 18:06:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 200BE6E2B4 for ; Tue, 25 Jul 2017 18:06:40 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPXsH-1dVPWT2y0n-004m4Y; Tue, 25 Jul 2017 20:06:00 +0200 From: Arnd Bergmann To: Xinliang Liu , Rongrong Zou , Daniel Vetter Subject: [PATCH v2] drm/hisilicon: fix build error without fbdev emulation Date: Tue, 25 Jul 2017 20:05:31 +0200 Message-Id: <20170725180555.3699056-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:EBogfDcMeH6xdbFs4W/hPLXBlkXbLSGFvTOC2aqTG+y6pjwPxo+ IG7jtgXjQ/tnE+rnte+KCFZlJmCW1fkCjJp5BVatAzvqV1GP+2OTB9Ko0+oYKfRDX0m4sW8 xFY2NKnAwzTAD4ObFZ1k7T1FkkAkvncd3d+O/vT1IusMN3fyLjXx9HBo+PxXu2R+/MWEdTD 1rxItW0f8HGOEnJHfQV3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:SKV80TieOgM=:zgIPtS7fY5+1EtKc/aMcA9 AcdbG70nySV+SkfKpcfMFpWOTXA/RkgEzilV3blOTCwCTJKEcPSuKT8nYbdSbuxKgZm89qT1r EL37KZIjT6O/lNpBM7j3BWru9gVYmhpuW1h7xzLSHfJbWfA0BU/PvcB7NTyzE2DllutRh1abu E9C3syRPbRP0HBW+hVBvuc+qfz1vT0mKq274pX/cxRzhqzNH1gfgNkDg6JhylmT/RtGX6lPXt yFZCgGNjkTVaFrNKL0JGOzYLgWMoLzR5VKqVWb2rhxsWW5hl5QNCvJLbUoXsFRtDumSfzXk8k mDCzPMBqOlJU4ypaVkNHW1ysZY1dWQnaMbI63szhUEsYiiOHan/Z6zCJCRa+qqBLq/QDD+Cb7 pGvxLbBoUhzwdEVET2MWOyk40+aydxrgNQ/mmMN/rcn4V8GN5j2nFCBEBS4MkMRRvL+1JczgA WWGaPy537x/U7TNWB0CtrmN030UUdPTgyPtAkiZIn7NDyf6S5m1z4jSsM/oJFlBGrYjuQFwrn m/ey1mZ7p3BaPPWY0gBekTyrXDL1gXP9UvfUNVeHAEr+BvjmpjNRn7OYcjh5CWKZlBvlPaEyC dDDPjMu8gl6gIqEMJsuLxl2jwRGUJi/ivp6aLTQnhUYchIno+AmIsz0GYERPR0KU7DXFNRN4v CWf1LtzSDJJ3EPv2xP9TcnRmURgx7PeEE4nyHWZo8KyLgMDF5MxgD9qLrb6CZg3fDb9hUNO2P fLKnx9rmceMMS+mubkvdLYpqjJDSpD9gWY15GQ== Cc: Arnd Bergmann , Chen Feng , Russell King , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jani Nikula , Xinwei Kong , Thierry Reding , Shawn Guo , Gabriel Krisman Bertazi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 19 ++++++++----------- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 2 -- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 1178341c3858..5d2dfe92f62c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -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) { + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && 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,17 @@ 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 + .output_poll_changed = IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) ? + kirin_fbdev_output_poll_changed : NULL, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; @@ -121,14 +117,15 @@ static int kirin_drm_kms_init(struct drm_device *dev) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(dev); - priv->fbdev = drm_fbdev_cma_init(dev, 32, - dev->mode_config.num_connector); + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)) + 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: diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h index 7f60c64915d9..56cb62df065c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h @@ -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;