From patchwork Tue Sep 21 21:21:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 12508881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09301C433EF for ; Tue, 21 Sep 2021 21:21:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB86660F41 for ; Tue, 21 Sep 2021 21:21:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CB86660F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F8936E839; Tue, 21 Sep 2021 21:21:53 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 631876E839 for ; Tue, 21 Sep 2021 21:21:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4559760F24; Tue, 21 Sep 2021 21:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632259311; bh=/qSWIbShMWBa5x9vPNqVBXY3/tfR8X1Q/6APO+n3E8M=; h=From:To:Cc:Subject:Date:From; b=u+C4MxQyIHJogdIwFLOJnhMhHM+MjSY0I4hqwKXbS2eaXmMvybZtz3hLRy/zN2Kkh 4VbmovxiSEaNdqSMHf6s0wVZHuIyVjazh1jEWzU39NWQI/vYihl4s5NJl8mGem+Okd 0Zw9qlsbPmXkD22NFaRx6G9QdSHdBS5bzRUcaakuQyuPPQBZE/t9REnqJBxWoamhEt Y1Hw/jhACRoOZDlH2VajCJjL8J4jpcc9xBnJew4QW+ERRqOWCKck1YEnqXvxrobU5y NHfjdtv2OnkC8ZNnV7QYDBwm0mxWpXk0WZYxxRy+0Yf1yPoPAcncT869ozzew7DJgp XAz0XB4nwsTGg== From: Mark Brown To: Thomas Zimmermann , Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Mark Brown , Bartlomiej Zolnierkiewicz Subject: [PATCH] video: fbdev: gbefb: Only instantiate device when built for IP32 Date: Tue, 21 Sep 2021 22:21:02 +0100 Message-Id: <20210921212102.30803-1-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1303; h=from:subject; bh=/qSWIbShMWBa5x9vPNqVBXY3/tfR8X1Q/6APO+n3E8M=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhSkyy+ZgVzBZM7oBzf1FmoKw3YCH+vFjPuiZuIgHt 1OBvB0aJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYUpMsgAKCRAk1otyXVSH0KKyB/ 4hmzdZd71Qc0N3hTk+UlgM+anFiOMJZszXSBDnPXecSmwPJuB5Fc3terGOa/H3xRUqI2osAqBQoPii SqSv5/RgR/+mqYcgU4BOMe3AesZ9dycqOrIWZ9G95gTkWo/oMcF/4AAHVDNnDhsaHLZ3t0V4BQtcA2 As7ZgFBHUVqTRHiNsQMXOqm6xsGt/Ax3dipbYdCKOFeuFlVvGD50g19U+q8XgIUV8JrFJjG+/3pELF Q2y0hHeC1opGO8u3POmgcBlszTJHvvQphb2MIhiPCQEE25fa1m70RtNSlQoiynaFSvh55rE/Xmey8j mHTSwfT+GQzXz+f7GsEFuN4R+ougOU X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The gbefb driver not only registers a driver but also the device for that driver. This is all well and good when run on the IP32 machines that are supported by the driver but since the driver supports building with COMPILE_TEST we might also be building on other platforms which do not have this hardware and will crash instantiating the driver. Add an IS_ENABLED() check so we compile out the device registration if we don't have the Kconfig option for the machine enabled. Fixes: 552ccf6b259d290c0c ("video: fbdev: gbefb: add COMPILE_TEST support") Signed-off-by: Mark Brown Cc: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/gbefb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index c5b99a4861e8..6b4d5a7f3e15 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1267,7 +1267,7 @@ static struct platform_device *gbefb_device; static int __init gbefb_init(void) { int ret = platform_driver_register(&gbefb_driver); - if (!ret) { + if (IS_ENABLED(CONFIG_SGI_IP32) && !ret) { gbefb_device = platform_device_alloc("gbefb", 0); if (gbefb_device) { ret = platform_device_add(gbefb_device);