From: Helge Deller <deller@gmx.de>
To: Chintan Patel <chintanlike@gmail.com>,
Helge Deller <deller@kernel.org>, andy <andy@kernel.org>
Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/4] fbdev: sh_mobile_lcdc: Make FB_DEVICE dependency optional
Date: Sat, 3 Jan 2026 10:59:44 +0100 [thread overview]
Message-ID: <73007a0a-dd96-43eb-be2e-ccbf8b19cd79@gmx.de> (raw)
In-Reply-To: <aa2b08f8-e6c3-4768-bce9-e36ad9d1e74b@gmail.com>
On 12/30/25 19:25, Chintan Patel wrote:
>
>
> On 12/30/25 00:13, Helge Deller wrote:
>> * Chintan Patel <chintanlike@gmail.com>:
>>> The sh_mobile_lcdc driver exposes overlay configuration via sysfs, but the
>>> core driver does not require CONFIG_FB_DEVICE.
>>>
>>> Make sysfs support optional by defining overlay_sysfs_groups conditionally
>>> using PTR_IF(). The driver always sets .dev_groups, and the kernel
>>> naturally skips NULL attribute groups while the code remains buildable
>>> and type-checked.
>>>
>>> Suggested-by: Helge Deller <deller@gmx.de>
>>> Signed-off-by: Chintan Patel <chintanlike@gmail.com>
>>> ---
>>> drivers/video/fbdev/sh_mobile_lcdcfb.c | 12 +++++++++++-
>>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
>>> index dd950e4ab5ce..cb7ed1ff9165 100644
>>> --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
>>> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
>>> @@ -1350,7 +1350,17 @@ static struct attribute *overlay_sysfs_attrs[] = {
>>> &dev_attr_overlay_rop3.attr,
>>> NULL,
>>> };
>>> -ATTRIBUTE_GROUPS(overlay_sysfs);
>>
>> Instead of replacing the ^ ATTRIBUTE_GROUPS() by the code below,
>> isn't it possible to just mark the overlay_sysfs_attrs[] array
>> _maybe_unused, and just do:
>> + #ifdef CONFIG_FB_DEVICE
>> + ATTRIBUTE_GROUPS(overlay_sysfs);
>> + #endif
>>
>> ?
> Hi Helge,
>
> Yes, the __maybe_unused + #ifdef ATTRIBUTE_GROUPS() approach would work.
>
> I went with the PTR_IF(IS_ENABLED()) pattern because Andy suggested
> using PTR_IF() to conditionally include overlay_sysfs_group in
> overlay_sysfs_groups, and to keep .dev_groups always populated while
> letting the device core skip NULL groups. This avoids conditional
> wiring via #ifdef and keeps the code type-checked without
> CONFIG_FB_DEVICE.
> If you still prefer the simpler #ifdef ATTRIBUTE_GROUPS() approach
> for this driver, I can switch to that, but I wanted to follow Andy’s
> guidance here.
I assume Andy will agree to my suggested approach, as it's cleaner
and avoids code bloat/duplication. Maybe you send out a v4 with my
suggested approach, then it's easier to judge... ?
Helge
next prev parent reply other threads:[~2026-01-03 9:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 5:28 [PATCH v3 0/4] fbdev: Make CONFIG_FB_DEVICE optional for drivers Chintan Patel
2025-12-30 5:28 ` [PATCH v3 1/4] fb: Add dev_of_fbinfo() helper for optional sysfs support Chintan Patel
2025-12-30 5:28 ` [PATCH v3 2/4] staging: fbtft: Make FB_DEVICE dependency optional Chintan Patel
2025-12-30 8:03 ` Helge Deller
2025-12-30 5:28 ` [PATCH v3 3/4] fbdev: omapfb: " Chintan Patel
2025-12-30 8:05 ` Helge Deller
2025-12-30 11:37 ` Andy Shevchenko
2025-12-30 18:01 ` Chintan Patel
2025-12-30 22:42 ` Andy Shevchenko
2025-12-30 5:28 ` [PATCH v3 4/4] fbdev: sh_mobile_lcdc: " Chintan Patel
2025-12-30 8:13 ` Helge Deller
2025-12-30 18:25 ` Chintan Patel
2026-01-03 9:59 ` Helge Deller [this message]
2026-01-03 13:15 ` Andy Shevchenko
2026-01-06 5:07 ` Chintan Patel
2025-12-30 11:35 ` Andy Shevchenko
2025-12-30 10:42 ` [PATCH v3 0/4] fbdev: Make CONFIG_FB_DEVICE optional for drivers Geert Uytterhoeven
2025-12-30 11:33 ` Andy Shevchenko
2025-12-30 17:59 ` Chintan Patel
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=73007a0a-dd96-43eb-be2e-ccbf8b19cd79@gmx.de \
--to=deller@gmx.de \
--cc=andy@kernel.org \
--cc=chintanlike@gmail.com \
--cc=deller@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.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