From: Javier Garcia <rampxxxx@gmail.com>
To: deller@gmx.de, u.kleine-koenig@baylibre.com, tzimmermann@suse.de
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, shuah@kernel.org,
Javier Garcia <rampxxxx@gmail.com>
Subject: [PATCH v3] fbdev: mb862xxfbdrv: Make CONFIG_FB_DEVICE optional
Date: Wed, 8 Oct 2025 20:36:27 +0200 [thread overview]
Message-ID: <20251008183627.1279115-1-rampxxxx@gmail.com> (raw)
In-Reply-To: <20251006164143.1187434-1-rampxxxx@gmail.com>
This patch wraps the relevant code blocks with `IS_ENABLED(CONFIG_FB_DEVICE)`.
Allows the driver to be used for framebuffer text console, even if
support for the /dev/fb device isn't compiled-in (CONFIG_FB_DEVICE=n).
This align with Documentation/drm/todo.rst
"Remove driver dependencies on FB_DEVICE"
I've not the card so I was not able to test it.
Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
---
v2 -> v3:
* Change commit msg , thanks Helge Deller.
* Delete not used include , thanks Uwe Kleine-Koenig.
* v1 https://lore.kernel.org/lkml/20251006164143.1187434-1-rampxxxx@gmail.com/
v1 -> v2:
* Fix error and improvement , thanks Uwe Kleine-Koenig.
* v1 https://lore.kernel.org/lkml/20251005173812.1169436-1-rampxxxx@gmail.com
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
index ade88e7bc760..3f79dfc27a53 100644
--- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
@@ -759,7 +759,7 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev)
dev_set_drvdata(dev, info);
- if (device_create_file(dev, &dev_attr_dispregs))
+ if (IS_ENABLED(CONFIG_FB_DEVICE) && device_create_file(dev, &dev_attr_dispregs))
dev_err(dev, "Can't create sysfs regdump file\n");
return 0;
@@ -801,7 +801,8 @@ static void of_platform_mb862xx_remove(struct platform_device *ofdev)
free_irq(par->irq, (void *)par);
irq_dispose_mapping(par->irq);
- device_remove_file(&ofdev->dev, &dev_attr_dispregs);
+ if (IS_ENABLED(CONFIG_FB_DEVICE))
+ device_remove_file(&ofdev->dev, &dev_attr_dispregs);
unregister_framebuffer(fbi);
fb_dealloc_cmap(&fbi->cmap);
@@ -1101,7 +1102,7 @@ static int mb862xx_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, info);
- if (device_create_file(dev, &dev_attr_dispregs))
+ if (IS_ENABLED(CONFIG_FB_DEVICE) && device_create_file(dev, &dev_attr_dispregs))
dev_err(dev, "Can't create sysfs regdump file\n");
if (par->type == BT_CARMINE)
@@ -1151,7 +1152,8 @@ static void mb862xx_pci_remove(struct pci_dev *pdev)
mb862xx_i2c_exit(par);
- device_remove_file(&pdev->dev, &dev_attr_dispregs);
+ if (IS_ENABLED(CONFIG_FB_DEVICE))
+ device_remove_file(&pdev->dev, &dev_attr_dispregs);
unregister_framebuffer(fbi);
fb_dealloc_cmap(&fbi->cmap);
--
2.50.1
next prev parent reply other threads:[~2025-10-08 18:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 16:41 [PATCH v2] " Javier Garcia
2025-10-06 23:52 ` Helge Deller
2025-10-07 6:57 ` Uwe Kleine-König
2025-10-08 18:36 ` Javier Garcia [this message]
2025-10-08 23:00 ` [PATCH v3] " Helge Deller
2025-10-09 8:50 ` Uwe Kleine-König
2025-10-10 12:08 ` Helge Deller
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=20251008183627.1279115-1-rampxxxx@gmail.com \
--to=rampxxxx@gmail.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=tzimmermann@suse.de \
--cc=u.kleine-koenig@baylibre.com \
/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®