Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2231545rwl; Thu, 6 Apr 2023 07:33:12 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+nc46U2FLRUm66hoKAc6emNPve6QQwLwwX5Zcbn8GBVEqlsjwVujjaGJ4Oeg2lqrYHhdM X-Received: by 2002:a17:906:ecb5:b0:931:d350:9aef with SMTP id qh21-20020a170906ecb500b00931d3509aefmr6771690ejb.25.1680791591924; Thu, 06 Apr 2023 07:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680791591; cv=none; d=google.com; s=arc-20160816; b=wTmOZlrgSMoM9OCDUTMPrpDExDmQC7ebVcQNKQWZ+YEP0AlNAZUeF7mpPNxOuXJEMD 3ggXqq+JG4KZHMOWWiF1FE+oAMgno7sFdcSlN0/w4WWZv1T1GDNodEwCDdV0mP027jXc 4H1FGL7el1L7ZlthLDEHy2qbJitMZczrc4Zs+KFRVMJZ+GYqIIPTjewwpZnQ56NeI1cp ++P9YwV80zGUWHcLz2A/+I/fEU5gnn5G+tx6gSpwamrxUfOvWQkbFR3RJ3SLxaQkOmJn wyvc6PF3ClFmSxrMv4Hls8Yhsuw6S4AA3Sxgws2n4WBbVqxJLdGDn2kOtul6N17hgv9A 70kg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=/rz0KVXgl7eygxSOZmb7rFdY5CLJi8hQKmbruW8U1YU=; b=e3f+L+9UChoJ193C8XvCiG0Y/oTQytnYqHLTSZXjgk7YIOBBFJB/gT2PkHmteu4QUR sC3X1eQC3nMED6cGevi1/md0qIh8RR+/b053w3pEUvXT/BjsPdivYcqmeW+dxMSROy5v BJQ+Lb/KNR0ygvZoe+L0oaLB5EDmnaz9cMc1vBVWmVFaT0u7b3N+LilojYpWGVNhz+89 +JDub+v8wJuTcE/ae6oDfkfd2AEgZugvlLlIIm26379HFD6UJjhsco2035Dh7V2HiUkD XnIj1G6VyVImMJvPWLKMnSg4+L4Fv0nCLdtfIW8bOqxsHvw4WONRU3D8yVoz3SpdGm/t AjCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=BxgYle6l; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a056402150100b00502241c86afsi1229573edw.320.2023.04.06.07.32.45; Thu, 06 Apr 2023 07:33:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=BxgYle6l; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239136AbjDFObi (ORCPT + 99 others); Thu, 6 Apr 2023 10:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239156AbjDFOaf (ORCPT ); Thu, 6 Apr 2023 10:30:35 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92799EE8; Thu, 6 Apr 2023 07:30:29 -0700 (PDT) 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 7374122778; Thu, 6 Apr 2023 14:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680791428; 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=/rz0KVXgl7eygxSOZmb7rFdY5CLJi8hQKmbruW8U1YU=; b=BxgYle6lCFlI9LG4wwyxRk8JjByFMYDE05ntDs/+3lCByHu3LSwXqx7Fxtth+7eKvb/xTM G+YjqqnoRkE0S/CW05o3MnqOoYEGnv8ql4/t6JEAbVJv3FYw5LekYKLXp0jcI7J7bFlq6J Ax/Dp9T40zv2BkfFWUZkBQ+SdzF68D0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680791428; 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=/rz0KVXgl7eygxSOZmb7rFdY5CLJi8hQKmbruW8U1YU=; b=sO51GWW37aP7igi4ArliUC5lhnHNsTSeWxf4/7DO9NqAn3tzTgpF/0dJVBnO12rKSCbsEB pYUrFjo1LADLThDg== 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 F202F13A1D; Thu, 6 Apr 2023 14:30:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gCszOoPXLmS4LgAAMHmgww (envelope-from ); Thu, 06 Apr 2023 14:30:27 +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 v2 17/19] arch/sparc: Implement fb_is_primary_device() in source file Date: Thu, 6 Apr 2023 16:30:17 +0200 Message-Id: <20230406143019.6709-18-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230406143019.6709-1-tzimmermann@suse.de> References: <20230406143019.6709-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 . v2: * don't include in header file Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" --- arch/sparc/Makefile | 1 + arch/sparc/include/asm/fb.h | 23 +++++------------------ arch/sparc/video/Makefile | 3 +++ arch/sparc/video/fbdev.c | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 18 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..28609f7a965c 100644 --- a/arch/sparc/include/asm/fb.h +++ b/arch/sparc/include/asm/fb.h @@ -1,11 +1,12 @@ /* 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 +16,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); -- 2.40.0