From patchwork Mon Oct 11 13:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 515616 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp4465796ime; Mon, 11 Oct 2021 06:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy580g6YeWwEr/JThgpp276qhXXbZ2sgV8R3NmM4/E7B5PalrQMPHISAfjIgMu/zLitNzU1 X-Received: by 2002:a17:902:a385:b0:13e:99e9:17f3 with SMTP id x5-20020a170902a38500b0013e99e917f3mr24564818pla.65.1633960634086; Mon, 11 Oct 2021 06:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633960634; cv=none; d=google.com; s=arc-20160816; b=mbWLVvTq7Kcjs2iHmGNhWSELsYPXQG/uvEOFaFdkRsAOe+7dBUaOYOCwgAqYmA5ywF 0TlkHXAzH+oyd2GQAEH/H+utjJzc2x2gSclfFgiIbghvjb6Vt83AELx0S74j47x/BaeS E/7Wt94iNafHMIyVsC411zU0T1DPDrfo9XCLJhVoiLxjz/p2CwCmZ2j7Tu+jzNNOcJ2I 9V8+2snpydxf5Budacaam1ZEyfCfa3gY9aPjjMuauseU60LB61Tm6pjSI5Bzlwq7ieZg X2hHbqgGQtKuvhKTLB7oa4NLqfcTsnQkIufkCK/OAI1qlVL1/SzKUHPrnASPojqZ5xkx Bs4g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ie6S63KLzNfY9bd3LpZyUkylEEaa/5aai+wcWnW1o6w=; b=swHeANha9o33eVmMKxNiMskq87TjjeMbXBl2F0cTOqq3jv34zxWyQiLmZ/cLkT8a5u 12P9BVO8JIkQka5AeOT2k7yId3UVPYyrTpzej6Gxg+vDbEevN/oId+jbTUko1nGAaicL bxu5MtR5rCEI6y45LuhYQkOlk1EK+ngMgqTHZsdSGQVBMzyDgYnNrJHuCV8L9HcpTi16 VsPxZmXv0lmdT0nqF8tuIxlVbVD6XdJaioIfwbe3GFt6pQlWNuc6fh3lv8ic8SVbDNgn LQlgK11XuQc6j5RbCR61XArwAABNuQi9yPAFF4pyRYgv8j7tSZKX8Sx1RU4ffIHAf3CZ SKAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=urY4GRHt; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si12361563pgb.47.2021.10.11.06.57.13; Mon, 11 Oct 2021 06:57:14 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=urY4GRHt; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237070AbhJKN6y (ORCPT + 11 others); Mon, 11 Oct 2021 09:58:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:40614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237863AbhJKN4l (ORCPT ); Mon, 11 Oct 2021 09:56:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E12866113D; Mon, 11 Oct 2021 13:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960422; bh=sb6Z8opnOOKio5yqaSbWt+6ANeHcv8rWixoNds1Tfiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urY4GRHtyoJ7QOTq+Rkd/nehRMGt6uYU/gJUd6of+2clYBdaGTtIFk/mv1DhkQv4d 6RTkJI+h9QjfL9jonO0aooO2GhamUWJTcL7KmiUUvBem8IKhIbAVbdw+B03i8AkIJo whAUOLcHVqJo/3JmtiRHKybxB587/HzmoWSqVSv4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Bartlomiej Zolnierkiewicz , Daniel Vetter , Maarten Lankhorst , Sasha Levin Subject: [PATCH 5.10 55/83] video: fbdev: gbefb: Only instantiate device when built for IP32 Date: Mon, 11 Oct 2021 15:46:15 +0200 Message-Id: <20211011134510.290610197@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown [ Upstream commit 11b8e2bb986d23157e82e267fb8cc6b281dfdee9 ] 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 Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210921212102.30803-1-broonie@kernel.org Signed-off-by: Maarten Lankhorst Signed-off-by: Sasha Levin --- drivers/video/fbdev/gbefb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.33.0 diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 31270a8986e8..8f8ca1f88fe2 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1269,7 +1269,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);