From patchwork Wed Aug 24 08:27:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9297111 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 4B0CA607D0 for ; Wed, 24 Aug 2016 08:28:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F0C528E62 for ; Wed, 24 Aug 2016 08:28:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33C2628E7C; Wed, 24 Aug 2016 08:28:11 +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 AD8AE28E62 for ; Wed, 24 Aug 2016 08:28:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CD116E034; Wed, 24 Aug 2016 08:28:08 +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 [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29FBE6E034 for ; Wed, 24 Aug 2016 08:28:06 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0LsQye-1b9yJa2Av2-011w8I; Wed, 24 Aug 2016 10:27:42 +0200 From: Arnd Bergmann To: Daniel Vetter Subject: [PATCH] fb: udl: fix build without CONFIG_FB_DEFERRED_IO Date: Wed, 24 Aug 2016 10:27:15 +0200 Message-Id: <20160824082738.703060-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:9HiDbrZywDEyGvtCPVdxQQqGDSH4/YiO3VYjkBAuY/aXmSyLmrc 9O3VOcs0H30r/el2RMwqNGa+nfRoEh9wVy8rI9z6psTbpdUhLWm0+Mo2vrCojw7OQ7Te+hF TIKUdcLFI7RGMOuT10N3clnDMMH0WWENXn2ESm+BoKNdXP5ckO2nZvgPuvFjc+rgq+wcmSe ZyIqRPZHtOMXLwBeuzboQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:DiMBuWUu0X0=:uhAEqIMCmsJMaI9VUfQfq0 Ew12UmqtVvZN4Bbm5hHalcTVV0Ny2DTdtkL9HRLGislvUgtSMUsvGqnEZsAkjk/EaAlORmhlX jEn6Lz5ZYyopA0TPFiAdubGgy3tb2Ompzk5xrnLwFDHUBW83/fXHl5qSjbzlUuCOU+/p1pQja 3PW0D3HFyjvOgoYDhMs/p9tEUcpAuNudTe2gosa7QTpialzwSUOPwP9W3EScR0uJ719t5lSew 9W2GKAcVAe1+sUzNckCX4gJHAuUKFJuvUa5E62rsN5yOk9TGHiLrk0O/AyC5ySJBqaXz+UO8c Sy0ZKJ7XPEQRYA65Tc/fakV8+dv21sF00OWDrUo1GDjRYxlKl6VkeCot3eB686RHE0GM8wV8l +aOamtSsk2gHu1ZIaFE3Xs+rW844/uoeVKiW+xUzhKFOXmp9AyaIQRHC0mhDiPqKSqdmpYWXX gbl0+5Fi3JMHC1AzmHCDqVS4peEQGm0x+HUNzpABJ/8lagRroRS+DEz4np+8jwxeWQITZyHFZ 91W/8003XA7qfsC6JM+0/TgdreYTdDYQionUB1kYHxguoQ6tFEmSSHAugH9c6Y2ZeNXAp83bx c2vMKDJQCEb4vGXkuHtz/YuZwLcrbsrpyiCk22/GzjdmQL5c06I0fiyyadGQNxL5JxJystMdU xWGSDSUu7kMCTfGB7MzEuD4REbS6hDflhVPvy59EDmRU6CdU/ibZR/Lfz9naMcJCwjNY= Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dave Airlie 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 A cleanup in v4.8 dropped several dependencies, but caused the udl driver to fail building when CONFIG_FB_DEFERRED_IO is not set: drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_open': drivers/gpu/drm/udl/udl_fb.c:206:23: error: 'struct fb_info' has no member named 'fbdefio' if (fb_defio && (info->fbdefio == NULL)) { ^~ This adds an #ifdef check around the code that fails. We know this is safe because it always checks info->fbdefio for being non-NULL, and that member is not defined here. Signed-off-by: Arnd Bergmann Fixes: c0f0c177b5a9 ("drm/udl: make fbdev support really optional") --- drivers/gpu/drm/udl/udl_fb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index d5df555aeba0..fec47733e57e 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -24,11 +24,14 @@ #define DL_DEFIO_WRITE_DELAY (HZ/20) /* fb_deferred_io.delay in jiffies */ -static int fb_defio = 0; /* Optionally enable experimental fb_defio mmap support */ static int fb_bpp = 16; module_param(fb_bpp, int, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); + +#ifdef CONFIG_FB_DEFERRED_IO +static int fb_defio = 0; /* Optionally enable experimental fb_defio mmap support */ module_param(fb_defio, int, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); +#endif struct udl_fbdev { struct drm_fb_helper helper; @@ -203,6 +206,7 @@ static int udl_fb_open(struct fb_info *info, int user) ufbdev->fb_count++; +#ifdef CONFIG_FB_DEFERRED_IO if (fb_defio && (info->fbdefio == NULL)) { /* enable defio at last moment if not disabled by client */ @@ -218,6 +222,7 @@ static int udl_fb_open(struct fb_info *info, int user) info->fbdefio = fbdefio; fb_deferred_io_init(info); } +#endif pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", info->node, user, info, ufbdev->fb_count); @@ -235,12 +240,14 @@ static int udl_fb_release(struct fb_info *info, int user) ufbdev->fb_count--; +#ifdef CONFIG_FB_DEFERRED_IO if ((ufbdev->fb_count == 0) && (info->fbdefio)) { fb_deferred_io_cleanup(info); kfree(info->fbdefio); info->fbdefio = NULL; info->fbops->fb_mmap = udl_fb_mmap; } +#endif pr_warn("released /dev/fb%d user=%d count=%d\n", info->node, user, ufbdev->fb_count);