]> www.infradead.org Git - users/hch/misc.git/commitdiff
Fix access to video_is_primary_device() when compiled without CONFIG_VIDEO
authorMario Limonciello (AMD) <superm1@kernel.org>
Mon, 11 Aug 2025 16:26:03 +0000 (11:26 -0500)
committerMario Limonciello (AMD) <superm1@kernel.org>
Wed, 10 Sep 2025 14:35:33 +0000 (09:35 -0500)
When compiled without CONFIG_VIDEO the architecture specific
implementations of video_is_primary_device() include prototypes and
assume that video-common.c will be linked. Guard against this so that the
fallback inline implementation that returns false will be used when
compiled without CONFIG_VIDEO.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506221312.49Fy1aNA-lkp@intel.com/
Link: https://lore.kernel.org/r/20250811162606.587759-2-superm1@kernel.org
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
arch/parisc/include/asm/video.h
arch/sparc/include/asm/video.h
arch/x86/include/asm/video.h

index c5dff3223194acee7ab5d0a76468af3fe7306634..a9d50ebd6e76935d6dff0ee3c023382d1f9f9dac 100644 (file)
@@ -6,7 +6,7 @@
 
 struct device;
 
-#if defined(CONFIG_STI_CORE)
+#if defined(CONFIG_STI_CORE) && defined(CONFIG_VIDEO)
 bool video_is_primary_device(struct device *dev);
 #define video_is_primary_device video_is_primary_device
 #endif
index a6f48f52db584b725434e1e25757bf3f176ec870..773717b6d49146df95fcb57dbe76786ca68f4ef6 100644 (file)
@@ -19,8 +19,10 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
 #define pgprot_framebuffer pgprot_framebuffer
 #endif
 
+#ifdef CONFIG_VIDEO
 bool video_is_primary_device(struct device *dev);
 #define video_is_primary_device video_is_primary_device
+#endif
 
 static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
 {
index 0950c9535fae9861ef102c4fe54e20037576b2ea..08ec328203ef810739fe339eb40a7bdae4cd47e6 100644 (file)
@@ -13,8 +13,10 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
                            unsigned long offset);
 #define pgprot_framebuffer pgprot_framebuffer
 
+#ifdef CONFIG_VIDEO
 bool video_is_primary_device(struct device *dev);
 #define video_is_primary_device video_is_primary_device
+#endif
 
 #include <asm-generic/video.h>