From: Thomas Zimmermann <tzimmermann@suse.de>
To: Gonzalo Silvalde Blanco <gonzalo.silvalde@gmail.com>,
linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org, thomas.zimmermann@suse.de
Subject: Re: [PATCH v2] fbdev: sstfb: Make CONFIG_FB_DEVICE optional
Date: Mon, 7 Oct 2024 10:56:29 +0200 [thread overview]
Message-ID: <18c5cd42-080d-4e1d-b34f-f3fed750ef8f@suse.de> (raw)
In-Reply-To: <20241004152429.4329-1-gonzalo.silvalde@gmail.com>
Hi
Am 04.10.24 um 17:24 schrieb Gonzalo Silvalde Blanco:
> The sstfb driver currently depends on CONFIG_FB_DEVICE to create sysfs
> entries and access info->dev. This patch wraps the relevant code blocks
> with #ifdef CONFIG_FB_DEVICE, allowing the driver to be built and used
> even if CONFIG_FB_DEVICE is not selected.
>
> The sysfs setting only controls the VGA pass-through state and is not
> required for the display to work correctly.
> (See: http://vogonswiki.com/index.php/VGA_passthrough_cable
> for more information.)
>
> Tested by building with and without CONFIG_FB_DEVICE, both of which
> compiled without issues.
>
> Signed-off-by: Gonzalo Silvalde Blanco <gonzalo.silvalde@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
One thing I forgot, is that you also have to remove the dependency from
the Kconfig option. [1] Otherwise, it won't be possible to select the
driver.
Best regards
Thomas
[1]
https://elixir.bootlin.com/linux/v6.11.2/source/drivers/video/fbdev/Kconfig#L1239
> ---
> drivers/video/fbdev/sstfb.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/sstfb.c b/drivers/video/fbdev/sstfb.c
> index f8ae54ca0cc3..8d2e9d1f8d80 100644
> --- a/drivers/video/fbdev/sstfb.c
> +++ b/drivers/video/fbdev/sstfb.c
> @@ -716,6 +716,7 @@ static void sstfb_setvgapass( struct fb_info *info, int enable )
> pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, tmp);
> }
>
> +#ifdef CONFIG_FB_DEVICE
> static ssize_t store_vgapass(struct device *device, struct device_attribute *attr,
> const char *buf, size_t count)
> {
> @@ -736,10 +737,10 @@ static ssize_t show_vgapass(struct device *device, struct device_attribute *attr
> struct sstfb_par *par = info->par;
> return sprintf(buf, "%d\n", par->vgapass);
> }
> -
> static struct device_attribute device_attrs[] = {
> __ATTR(vgapass, S_IRUGO|S_IWUSR, show_vgapass, store_vgapass)
> };
> +#endif
>
> static int sstfb_ioctl(struct fb_info *info, unsigned int cmd,
> unsigned long arg)
> @@ -1435,10 +1436,10 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> }
>
> sstfb_clear_screen(info);
> -
> +#fdef CONFIG_FB_DEVICE
> if (device_create_file(info->dev, &device_attrs[0]))
> printk(KERN_WARNING "sstfb: can't create sysfs entry.\n");
> -
> +#endif
>
> fb_info(info, "%s frame buffer device at 0x%p\n",
> fix->id, info->screen_base);
> @@ -1467,8 +1468,9 @@ static void sstfb_remove(struct pci_dev *pdev)
>
> info = pci_get_drvdata(pdev);
> par = info->par;
> -
> +#ifdef CONFIG_FB_DEVICE
> device_remove_file(info->dev, &device_attrs[0]);
> +#endif
> sst_shutdown(info);
> iounmap(info->screen_base);
> iounmap(par->mmio_vbase);
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
next prev parent reply other threads:[~2024-10-07 8:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 21:45 [PATCH] Subject: fbdev: sstfb: Make CONFIG_FB_DEVICE optional Gonzalo Silvalde Blanco
2024-10-04 9:06 ` Thomas Zimmermann
2024-10-04 15:24 ` [PATCH v2] " Gonzalo Silvalde Blanco
2024-10-07 8:56 ` Thomas Zimmermann [this message]
2024-10-07 12:06 ` kernel test robot
2024-10-07 12:48 ` kernel test robot
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=18c5cd42-080d-4e1d-b34f-f3fed750ef8f@suse.de \
--to=tzimmermann@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gonzalo.silvalde@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=thomas.zimmermann@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).