Skip to content

Commit 11b8e2b

Browse files
brooniemlankhorst
authored andcommitted
video: fbdev: gbefb: Only instantiate device when built for IP32
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: 552ccf6 ("video: fbdev: gbefb: add COMPILE_TEST support") Signed-off-by: Mark Brown <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent ec7cc3f commit 11b8e2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/gbefb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ static struct platform_device *gbefb_device;
12671267
static int __init gbefb_init(void)
12681268
{
12691269
int ret = platform_driver_register(&gbefb_driver);
1270-
if (!ret) {
1270+
if (IS_ENABLED(CONFIG_SGI_IP32) && !ret) {
12711271
gbefb_device = platform_device_alloc("gbefb", 0);
12721272
if (gbefb_device) {
12731273
ret = platform_device_add(gbefb_device);

0 commit comments

Comments
 (0)