linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
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 <tzimmermann@suse.de>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 16/18] arch/sparc: Implement fb_is_primary_device() in source file
Date: Wed,  5 Apr 2023 17:05:52 +0200	[thread overview]
Message-ID: <20230405150554.30540-17-tzimmermann@suse.de> (raw)
In-Reply-To: <20230405150554.30540-1-tzimmermann@suse.de>

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 <asm/fb.h>.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "David S. Miller" <davem@davemloft.net>
---
 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 <linux/console.h>
-#include <linux/fb.h>
+
 #include <linux/fs.h>
+
 #include <asm/page.h>
 #include <asm/prom.h>
 
+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 <linux/console.h>
+#include <linux/fb.h>
+#include <linux/module.h>
+
+#include <asm/fb.h>
+#include <asm/prom.h>
+
+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


  parent reply	other threads:[~2023-04-05 15:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 15:05 [PATCH 00/18] arch: Consolidate <asm/fb.h> Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 01/18] fbdev: Prepare generic architecture helpers Thomas Zimmermann
2023-04-05 15:53   ` Arnd Bergmann
2023-04-05 16:07     ` Daniel Vetter
2023-04-05 18:33     ` Thomas Zimmermann
2023-04-06 14:06     ` Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 02/18] arch/arc: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 03/18] arch/arm: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 04/18] arch/arm64: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 05/18] arch/ia64: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 06/18] arch/loongarch: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 07/18] arch/m68k: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 08/18] arch/mips: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 09/18] video: Remove trailing whitespaces Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 10/18] video: Move HP PARISC STI core code to shared location Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 11/18] arch/parisc: Remove trailing whitespaces Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 12/18] arch/parisc: Implement fb_is_primary_device() under arch/parisc Thomas Zimmermann
2023-04-06 19:08   ` Rolf Eike Beer
2023-04-05 15:05 ` [PATCH 13/18] arch/parisc: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 14/18] arch/powerpc: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 15/18] arch/sh: " Thomas Zimmermann
2023-04-05 15:05 ` Thomas Zimmermann [this message]
2023-04-05 15:05 ` [PATCH 17/18] arch/sparc: " Thomas Zimmermann
2023-04-05 15:05 ` [PATCH 18/18] arch/x86: " Thomas Zimmermann
2023-04-06 19:06 ` [PATCH 00/18] arch: Consolidate <asm/fb.h> Rolf Eike Beer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230405150554.30540-17-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=arnd@arndb.de \
    --cc=daniel.vetter@ffwll.ch \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=sparclinux@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).