mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Chintan Patel <chintanlike@gmail.com>,
	linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-omap@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	andy@kernel.org, deller@gmx.de, gregkh@linuxfoundation.org
Subject: Re: [PATCH v4 3/4] fbdev: omapfb: Make FB_DEVICE dependency optional
Date: Wed, 7 Jan 2026 08:33:21 +0100	[thread overview]
Message-ID: <aa922030-b0a1-4503-a3c0-7ce4c36c236e@suse.de> (raw)
In-Reply-To: <20260107044258.528624-4-chintanlike@gmail.com>



Am 07.01.26 um 05:42 schrieb Chintan Patel:
> omapfb provides several sysfs interfaces for framebuffer configuration
> and debugging, but these are not required for the core driver.
>
> Remove the hard dependency on CONFIG_FB_DEVICE and make sysfs support
> optional by using dev_of_fbinfo() to obtain the backing device at runtime.
> When FB_DEVICE is disabled, sysfs operations are skipped while the code
> still builds and is type-checked.
>
> Suggested-by: Helge Deller <deller@gmx.de>
> Signed-off-by: Chintan Patel <chintanlike@gmail.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/omap2/omapfb/Kconfig       |  3 ++-
>   .../video/fbdev/omap2/omapfb/omapfb-sysfs.c    | 18 ++++++++++++++----
>   2 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/omapfb/Kconfig b/drivers/video/fbdev/omap2/omapfb/Kconfig
> index f4cdf999a080..2d20e79adefc 100644
> --- a/drivers/video/fbdev/omap2/omapfb/Kconfig
> +++ b/drivers/video/fbdev/omap2/omapfb/Kconfig
> @@ -5,7 +5,6 @@ config OMAP2_VRFB
>   menuconfig FB_OMAP2
>   	tristate "OMAP2+ frame buffer support"
>   	depends on FB
> -	depends on FB_DEVICE
>   	depends on DRM_OMAP = n
>   	depends on GPIOLIB
>   	select FB_OMAP2_DSS
> @@ -13,6 +12,8 @@ menuconfig FB_OMAP2
>   	select FB_IOMEM_HELPERS
>   	help
>   	  Frame buffer driver for OMAP2+ based boards.
> +	  FB_DEVICE is not required, but if enabled, provides sysfs interface
> +	  for framebuffer configuration and debugging.
>   
>   if FB_OMAP2
>   
> diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> index 831b2c2fbdf9..38a635d38d58 100644
> --- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> @@ -558,10 +558,15 @@ int omapfb_create_sysfs(struct omapfb2_device *fbdev)
>   
>   	DBG("create sysfs for fbs\n");
>   	for (i = 0; i < fbdev->num_fbs; i++) {
> +		struct device *dev;
>   		int t;
> +
> +		dev = dev_of_fbinfo(fbdev->fbs[i]);
> +		if (!dev)
> +			continue;
> +
>   		for (t = 0; t < ARRAY_SIZE(omapfb_attrs); t++) {
> -			r = device_create_file(fbdev->fbs[i]->dev,
> -					&omapfb_attrs[t]);
> +			r = device_create_file(dev, &omapfb_attrs[t]);
>   
>   			if (r) {
>   				dev_err(fbdev->dev, "failed to create sysfs "
> @@ -580,9 +585,14 @@ void omapfb_remove_sysfs(struct omapfb2_device *fbdev)
>   
>   	DBG("remove sysfs for fbs\n");
>   	for (i = 0; i < fbdev->num_fbs; i++) {
> +		struct device *dev;
> +
> +		dev = dev_of_fbinfo(fbdev->fbs[i]);
> +		if (!dev)
> +			continue;
> +
>   		for (t = 0; t < ARRAY_SIZE(omapfb_attrs); t++)
> -			device_remove_file(fbdev->fbs[i]->dev,
> -					&omapfb_attrs[t]);
> +			device_remove_file(dev, &omapfb_attrs[t]);
>   	}
>   }
>   

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



  reply	other threads:[~2026-01-07  7:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  4:42 [PATCH v4 0/4] fbdev: Make CONFIG_FB_DEVICE optional for drivers Chintan Patel
2026-01-07  4:42 ` [PATCH v4 1/4] fb: Add dev_of_fbinfo() helper for optional sysfs support Chintan Patel
2026-01-07  7:32   ` Thomas Zimmermann
2026-01-11 18:50   ` Helge Deller
2026-01-11 19:51     ` Chintan Patel
2026-01-07  4:42 ` [PATCH v4 2/4] staging: fbtft: Make FB_DEVICE dependency optional Chintan Patel
2026-01-07  7:33   ` Thomas Zimmermann
2026-01-07 15:16   ` Andy Shevchenko
2026-01-07  4:42 ` [PATCH v4 3/4] fbdev: omapfb: " Chintan Patel
2026-01-07  7:33   ` Thomas Zimmermann [this message]
2026-01-11 18:52     ` Helge Deller
2026-01-07  4:42 ` [PATCH v4 4/4] fbdev: sh_mobile_lcdc: " Chintan Patel
2026-01-07  7:33   ` Thomas Zimmermann

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=aa922030-b0a1-4503-a3c0-7ce4c36c236e@suse.de \
    --to=tzimmermann@suse.de \
    --cc=andy@kernel.org \
    --cc=chintanlike@gmail.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®