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: 514435 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp3497555jao; Tue, 21 Sep 2021 14:21:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpaTEStud36rUNrANEOZwoEX8AI3tTjmV5hTp/GD+q64fm/UPs/Le7dF9BiLHfobzc7pYx X-Received: by 2002:a17:906:24c1:: with SMTP id f1mr37773615ejb.314.1632259314332; Tue, 21 Sep 2021 14:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632259314; cv=none; d=google.com; s=arc-20160816; b=gk2SPAJOHLUI9ReTpWk9bNL1UV3yZQ3DF0pqp0D743bqCFcCe96lUbfb9Vg+rm/OUF uypcbJV9of+KCxJCrO9YTKw604rROdkb9QuzGEwFu+fJf7XaHuwxmJE1TUPPMpwbJt9Y 88MoRwF/f0RpWXMyzbVtQLBnFnZRGd/Uywwmanj/DjltM3KsQ5CJTSYqOnG62kBHn5vJ 4FTCMUHzd6+s3kZGQTWbMV5f4GvFERJHE/LNkIWxx5ufXX1bE31TT3DxNgrQOYLRfPa2 Kq6DBn4JBFzx9WHRfgv4ytcEVQc2fJVHNHXJbh4k4U3SpBFzu5RVJx+Ug+m8336hpPWi 5F9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9NGXQOuls0dzjbkxMpVEzz10KbE4/uFgLkzTYAFNoew=; b=Snf2W1HMSedle2HXJTKUQ3E6TKEWdDnn7MQM1ALPf37pLtqhOum4wnqtpmK3VbQuQw VwdW5yKFlKU9yYHCduCbIZnOBIfAJXPWN/UFXA/95kuE7qwVdQRMv03CEWB7xKUbcEfF B+gdLkSKZZ/tcFxwFSVNz6mkSKBdp1K4gfOuFfcsGXkTUmdOCOiRWnzNLyh/Ghs+Ohsi b8N8xm8VW3ZVfWZVP7vZME5XYGvmUxBuh+jEnoNTH6r6tYxy7QL6W2Y/AhtcASoFVf6s 7/aL+ehnot+720TJGVnmEt1vGRnIa+nrS0sbevK4/hM22DSpkrpev76TxG8LHcmfkCS1 dhSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u+C4MxQy; spf=pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si243169edh.403.2021.09.21.14.21.54 for ; Tue, 21 Sep 2021 14:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u+C4MxQy; spf=pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbhIUVXV (ORCPT ); Tue, 21 Sep 2021 17:23:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:44032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbhIUVXU (ORCPT ); Tue, 21 Sep 2021 17:23:20 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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(-) -- 2.20.1 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);