lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc30b905-7db9-4d7a-98f6-b2c8c6f3d430@suse.de>
Date: Wed, 7 Jan 2026 08:33:01 +0100
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Chintan Patel <chintanlike@...il.com>, linux-fbdev@...r.kernel.org,
 linux-staging@...ts.linux.dev, linux-omap@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
 andy@...nel.org, deller@....de, gregkh@...uxfoundation.org
Subject: Re: [PATCH v4 2/4] staging: fbtft: Make FB_DEVICE dependency optional



Am 07.01.26 um 05:42 schrieb Chintan Patel:
> fbtft provides sysfs interfaces for debugging and gamma configuration,
> but these are not required for the core driver.
>
> Drop the hard dependency on CONFIG_FB_DEVICE and make sysfs support
> optional by using dev_of_fbinfo() at runtime. When FB_DEVICE is disabled,
> sysfs operations are skipped while the code remains buildable and
> type-checked.
>
> Suggested-by: Thomas Zimmermann <tzimmermann@...e.de>
> Suggested-by: Helge Deller <deller@....de>
> Reviewed-by: Helge Deller <deller@....de>
> Signed-off-by: Chintan Patel <chintanlike@...il.com>

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

> ---
>   drivers/staging/fbtft/Kconfig       |  5 ++++-
>   drivers/staging/fbtft/fbtft-sysfs.c | 20 ++++++++++++++++----
>   2 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
> index c2655768209a..578412a2f379 100644
> --- a/drivers/staging/fbtft/Kconfig
> +++ b/drivers/staging/fbtft/Kconfig
> @@ -2,11 +2,14 @@
>   menuconfig FB_TFT
>   	tristate "Support for small TFT LCD display modules"
>   	depends on FB && SPI
> -	depends on FB_DEVICE
>   	depends on BACKLIGHT_CLASS_DEVICE
>   	depends on GPIOLIB || COMPILE_TEST
>   	select FB_BACKLIGHT
>   	select FB_SYSMEM_HELPERS_DEFERRED
> +	help
> +	  Support for small TFT LCD display modules over SPI bus. FB_DEVICE
> +	  is not required, but if enabled, provides sysfs interface for debugging
> +	  and gamma curve configuration.
>   
>   if FB_TFT
>   
> diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
> index e45c90a03a90..d05599d80011 100644
> --- a/drivers/staging/fbtft/fbtft-sysfs.c
> +++ b/drivers/staging/fbtft/fbtft-sysfs.c
> @@ -203,14 +203,26 @@ static struct device_attribute debug_device_attr =
>   
>   void fbtft_sysfs_init(struct fbtft_par *par)
>   {
> -	device_create_file(par->info->dev, &debug_device_attr);
> +	struct device *dev;
> +
> +	dev = dev_of_fbinfo(par->info);
> +	if (!dev)
> +		return;
> +
> +	device_create_file(dev, &debug_device_attr);
>   	if (par->gamma.curves && par->fbtftops.set_gamma)
> -		device_create_file(par->info->dev, &gamma_device_attrs[0]);
> +		device_create_file(dev, &gamma_device_attrs[0]);
>   }
>   
>   void fbtft_sysfs_exit(struct fbtft_par *par)
>   {
> -	device_remove_file(par->info->dev, &debug_device_attr);
> +	struct device *dev;
> +
> +	dev = dev_of_fbinfo(par->info);
> +	if (!dev)
> +		return;
> +
> +	device_remove_file(dev, &debug_device_attr);
>   	if (par->gamma.curves && par->fbtftops.set_gamma)
> -		device_remove_file(par->info->dev, &gamma_device_attrs[0]);
> +		device_remove_file(dev, &gamma_device_attrs[0]);
>   }

-- 
--
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)



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ