mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
fb: Add dev_of_fbinfo() helper for optional sysfs support
Add dev_of_fbinfo() to return the framebuffer struct device when CONFIG_FB_DEVICE is enabled, or NULL otherwise. This allows fbdev drivers to use sysfs interfaces via runtime checks instead of CONFIG_FB_DEVICE ifdefs, keeping the code clean while remaining fully buildable. Suggested-by: Helge Deller <deller@gmx.de> Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Chintan Patel <chintanlike@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
8f582bcd13
commit
39b65316fe
|
|
@ -623,6 +623,15 @@ static inline void unlock_fb_info(struct fb_info *info)
|
|||
mutex_unlock(&info->lock);
|
||||
}
|
||||
|
||||
static inline struct device *dev_of_fbinfo(const struct fb_info *info)
|
||||
{
|
||||
#ifdef CONFIG_FB_DEVICE
|
||||
return info->dev;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
|
||||
u8 *src, u32 s_pitch, u32 height)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user