* [PATCH] video: fbdev: Request IO ports
@ 2026-11-11 15:02 Daniel Matyas
0 siblings, 0 replies; only message in thread
From: Daniel Matyas @ 2026-11-11 15:02 UTC (permalink / raw)
To: Jaya Kumar
Cc: Thomas Zimmermann, Helge Deller, linux-fbdev, dri-devel,
linux-kernel, Daniel Matyas
Some fbdev drivers do not request their memory correctly. Request the IO
ports' memory so no other driver may access them. Only request 1 byte,
because the inb() and out() are used for reading and writing.
Did not test on hardware.
Signed-off-by: Daniel Matyas <matyasdaniel006@gmail.com>
---
drivers/video/fbdev/arcfb.c | 8 ++++++++
drivers/video/fbdev/n411.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index b807cf07522d..6771a7409cde 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -481,6 +481,14 @@ static int arcfb_probe(struct platform_device *dev)
printk(KERN_WARNING "no IO addresses supplied\n");
goto err_addr;
}
+
+ if (!devm_request_region(&dev->dev, dio_addr, 1, "arcfb") ||
+ !devm_request_region(&dev->dev, cio_addr, 1, "arcfb") ||
+ !devm_request_region(&dev->dev, c2io_addr, 1, "arcfb")) {
+ retval = -EBUSY;
+ goto err_addr;
+ }
+
par->dio_addr = dio_addr;
par->cio_addr = cio_addr;
par->c2io_addr = c2io_addr;
diff --git a/drivers/video/fbdev/n411.c b/drivers/video/fbdev/n411.c
index a3677313396e..ed0281939d37 100644
--- a/drivers/video/fbdev/n411.c
+++ b/drivers/video/fbdev/n411.c
@@ -165,6 +165,11 @@ static int __init n411_init(void)
if (!n411_device)
return -ENOMEM;
+ if (!devm_request_region(&n411_device->dev, dio_addr, 1, "n411") ||
+ !devm_request_region(&n411_device->dev, cio_addr, 1, "n411") ||
+ !devm_request_region(&n411_device->dev, c2io_addr, 1, "n411"))
+ return -EBUSY;
+
ret = platform_device_add_data(n411_device, &n411_board,
sizeof(n411_board));
if (ret)
--
2.55.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-11 15:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 15:02 [PATCH] video: fbdev: Request IO ports Daniel Matyas
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®