Re: [PATCH 1/3] fbtft: Make sysfs and dev_*() logging conditional on FB_DEVICE

From
Chintan Patel <hidden>
Date
2025-12-10 04:24:49
Also in
dri-devel, linux-omap, linux-staging, lkml
Reply to
Thomas Zimmermann, 2025-12-09
Hi Thomas,

On 12/8/25 23:25, Thomas Zimmermann wrote:
Hi

Am 09.12.25 um 05:27 schrieb Chintan Patel:
quoted
The fbtft core and sysfs implementation unconditionally dereference
fb_info->dev and register sysfs attributes. When FB_DEVICE=n, these
fields are unavailable, leading to build failures.

This patch wraps all sysfs attribute creation/removal and dev_dbg/ dev_info
logging in #ifdef CONFIG_FB_DEVICE, with pr_*() fallbacks for the
non-FB_DEVICE case. This makes fbtft fully buildable when FB_DEVICE is
disabled.

Signed-off-by: Chintan Patel <redacted>
---
  drivers/staging/fbtft/fbtft-core.c  | 20 ++++++++++++++++++--
  drivers/staging/fbtft/fbtft-sysfs.c |  8 ++++++++
  2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/ fbtft/fbtft-core.c
index 9e7b84071174..dc967bdeabe8 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -365,9 +365,14 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,
      unsigned int val;
      int ret = 1;
+#ifdef CONFIG_FB_DEVICE
      dev_dbg(info->dev,
Rather use fb_dbg() [1] and similar helpers for logging. They only need the info pointer and do the correct output by themselves.

[1] https://elixir.bootlin.com/linux/v6.18/source/include/linux/fb.h#L895
Thank you for this pointer - I actually didnt now this existed. Will do v2.
Thread (11 messages) 11 messages, 4 authors, last reply 2025-12-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help