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: 108662 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp863413qge; Tue, 25 Jul 2017 11:06:44 -0700 (PDT) X-Received: by 10.99.95.76 with SMTP id t73mr20548952pgb.349.1501006004390; Tue, 25 Jul 2017 11:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501006004; cv=none; d=google.com; s=arc-20160816; b=TUouCnaQpCSc20U0JHzxQEPduy0+YCSVCh85W+ktme4+KJVK22jl22GsNu5+pXVIrM wp1dS44pbj9mINuoP4Mc6O6uyqWe/hsHrEmFqqOdiqJWggJ0mTyJcB6bSHBfO3Ne3GZp 1+YeIr3rUilwaUd356zxS4FaKOSZysMsyJMj9tsLjyL5yUxTouuGAW8xU4gXPOCDpwOn sCm9HaU9wM9RjJyBzseN5knJBQ4PETHayvtdI7AHvNtyBFY28Up2OT9cvFzFp2G6APjq VwWqctrEjJFgZQJ0TocS+RAcTebhJ+fVVrFBLn6y4/0/gBod2PXiJAcdOMkNkBKx24OS kOFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=LmzWq6IAYKAFvvRGTCEh6tKYjcy+x5KuN6sGa40aIUI=; b=o1DiZT6bF+4TLNPpJiT6oD4YVo9YH6+upR12dVs4HxPBMfailBe0DwSvUS1xKQZEyi wYnpI0CNn8+RuPrlfna1vGgPvdZSra8+6ZuPJRICHt7bSn1855EMSBy82x4c3Xa9wfqk uENJohUo/eOpV9QGAHS+zw3JGVBIKFQ4td9Fdex5sKDqnjYCbmJ78Oo35S+1fBbhpPSZ X041axnS+uAvjnSgzuESPvnAWCFNFGDJZUrHRkSiP5R+zMlrJGGdRU2a5TgzHtzKSkUX vZg8sW3GptTGNz/PVSunGzVX7NemQAHPfi5tWn8q5Yk5g5d5vCECgTDCiTGDY5HitxM1 BRnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id t8si5632440pgq.678.2017.07.25.11.06.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jul 2017 11:06:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org 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-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rb6CZg3fDb9hUNO2P 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" 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;