Skip to content

Commit 6e490de

Browse files
committed
Fix access to video_is_primary_device() when compiled without CONFIG_VIDEO
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>
1 parent 7acbe30 commit 6e490de

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

arch/parisc/include/asm/video.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
struct device;
88

9-
#if defined(CONFIG_STI_CORE)
9+
#if defined(CONFIG_STI_CORE) && defined(CONFIG_VIDEO)
1010
bool video_is_primary_device(struct device *dev);
1111
#define video_is_primary_device video_is_primary_device
1212
#endif

arch/sparc/include/asm/video.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
1919
#define pgprot_framebuffer pgprot_framebuffer
2020
#endif
2121

22+
#ifdef CONFIG_VIDEO
2223
bool video_is_primary_device(struct device *dev);
2324
#define video_is_primary_device video_is_primary_device
25+
#endif
2426

2527
static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
2628
{

arch/x86/include/asm/video.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ pgprot_t pgprot_framebuffer(pgprot_t prot,
1313
unsigned long offset);
1414
#define pgprot_framebuffer pgprot_framebuffer
1515

16+
#ifdef CONFIG_VIDEO
1617
bool video_is_primary_device(struct device *dev);
1718
#define video_is_primary_device video_is_primary_device
19+
#endif
1820

1921
#include <asm-generic/video.h>
2022

0 commit comments

Comments
 (0)