From patchwork Wed Apr 5 15:05:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13202003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 967BDC7619A for ; Wed, 5 Apr 2023 15:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QpE5S3D90qh98Bjmz08H6hKtPriU43nBivkgP6RXcxc=; b=eR+v2UzYl29Acx HsNFwZKmazUtRoyDPBgyjIQtmGjSYnoG6mn3SewOD7h7Fj+ooxyY3AL+02qszS/KfodtR6JYMuChV uWGKz1+td7CBNiFsV7l4GPIsIRLhc1J4k0B7X7M6xMBAcRpDKq/FNYkii+tKLm5EVziFgxcwilR60 37s1D6WnsLNDMVGQFR2m9ZbeXaHbp4rmSclzxq7OWtzfzn+8F+zVcdeXT3NA4FkucfH5tC4q4pV22 iosFbEwxlXLKijpPEzFlIOGJ6ITbIxcTgPnoP7fT5jaGAd9nhogrolk/Or+g47Uo6kGf3RkRQF7F9 unCft84lMRz7tB6xHP4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk4iu-004lzn-1p; Wed, 05 Apr 2023 15:06:56 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk4iB-004lK5-0w; Wed, 05 Apr 2023 15:06:16 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 274B42293C; Wed, 5 Apr 2023 15:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680707165; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X4mcJLom6ZAm6gh+Qd1GGG3mMDreyMyZXiAcH0v+nJE=; b=E3C7DIPuZcQ5ckXXJkhw97dBSeflzO3De8NBiQlBKzkJyWilzzov31ZlhZrvaM6qBEv9LF BgNnkJ+AwJLkAnA28SLHgOJHj/PYlPvqDP/99rk6emLo1vqI4dNPdZ4umFYXxhyMtxJeGZ w6VbcM7InoKAR87SbTp0vMX+F72xm7k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680707165; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X4mcJLom6ZAm6gh+Qd1GGG3mMDreyMyZXiAcH0v+nJE=; b=cJ+t5MdSDdGmLZipOoCQHDkUf4Wd2RAWkTB44d1La3+Z8S7vVgXgnU5qiIcmRpgdzSXrd+ hn/oD8fSciztSoDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AB1F213A10; Wed, 5 Apr 2023 15:06:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eHbtKFyOLWTPIAAAMHmgww (envelope-from ); Wed, 05 Apr 2023 15:06:04 +0000 From: Thomas Zimmermann To: arnd@arndb.de, daniel.vetter@ffwll.ch, deller@gmx.de, javierm@redhat.com, gregkh@linuxfoundation.org Cc: linux-arch@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Thomas Zimmermann , "David S. Miller" Subject: [PATCH 16/18] arch/sparc: Implement fb_is_primary_device() in source file Date: Wed, 5 Apr 2023 17:05:52 +0200 Message-Id: <20230405150554.30540-17-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405150554.30540-1-tzimmermann@suse.de> References: <20230405150554.30540-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_080611_502369_DC6D6E44 X-CRM114-Status: GOOD ( 17.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Other architectures implment fb_is_primary_device() in a source file. Do the same on sparc. No functional changes, but allows to remove several include statement from . Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" --- arch/sparc/Makefile | 1 + arch/sparc/include/asm/fb.h | 22 +++++----------------- arch/sparc/video/Makefile | 3 +++ arch/sparc/video/fbdev.c | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 arch/sparc/video/Makefile create mode 100644 arch/sparc/video/fbdev.c diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index a4ea5b05f288..95a9211e48e3 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile @@ -60,6 +60,7 @@ libs-y += arch/sparc/prom/ libs-y += arch/sparc/lib/ drivers-$(CONFIG_PM) += arch/sparc/power/ +drivers-$(CONFIG_FB) += arch/sparc/video/ boot := arch/sparc/boot diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h index f699962e9ddf..e4ef1955b2b6 100644 --- a/arch/sparc/include/asm/fb.h +++ b/arch/sparc/include/asm/fb.h @@ -1,12 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _SPARC_FB_H_ #define _SPARC_FB_H_ -#include -#include + #include + #include #include +struct fb_info; + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, unsigned long off) { @@ -15,20 +17,6 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, #endif } -static inline int fb_is_primary_device(struct fb_info *info) -{ - struct device *dev = info->device; - struct device_node *node; - - if (console_set_on_cmdline) - return 0; - - node = dev->of_node; - if (node && - node == of_console_device) - return 1; - - return 0; -} +int fb_is_primary_device(struct fb_info *info); #endif /* _SPARC_FB_H_ */ diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile new file mode 100644 index 000000000000..6baddbd58e4d --- /dev/null +++ b/arch/sparc/video/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only + +obj-$(CONFIG_FB) += fbdev.o diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c new file mode 100644 index 000000000000..dadd5799fbb3 --- /dev/null +++ b/arch/sparc/video/fbdev.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include + +#include +#include + +int fb_is_primary_device(struct fb_info *info) +{ + struct device *dev = info->device; + struct device_node *node; + + if (console_set_on_cmdline) + return 0; + + node = dev->of_node; + if (node && node == of_console_device) + return 1; + + return 0; +} +EXPORT_SYMBOL(fb_is_primary_device);