[PATCH] fbdev: atyfb: Fix the pcim_request_region() check
From: Stian Halseth
Date: Sun Nov 29 2026 - 17:28:18 EST
pcim_request_region() returns 0 on success and a negative error code
on failure. atyfb_pci_probe() tests it with "!". That was right for
request_mem_region(), which it replaced and which returned a pointer.
Now every probe that gets its region fails:
atyfb 0000:01:02.0: probe with driver atyfb failed with error -16
On a Sun Ultra 5 (onboard Mach64) there is no framebuffer console.
The screen stops at the early boot messages.
Test the return value for non-zero.
Tested on a Sun Ultra 5 with 7.3.6: atyfb binds the onboard Mach64
and fbcon takes over the console.
Fixes: 27c97be7f3c6 ("fbdev: atyfb: Convert to managed PCI and ioremap API")
Closes: https://github.com/sparclinux/issues/issues/133
Cc: stable@xxxxxxxxxxxxxxx # 7.3
Signed-off-by: Stian Halseth <stian@xxxxxx>
---
aty128fb has the same inverted check twice, from e36aa3669e0f
("fbdev: aty128fb: Convert to managed PCI and ioremap API"). I have no
Rage 128 to test a fix on, so it is not part of this patch.
drivers/video/fbdev/aty/atyfb_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index b1f3364..d19949c 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3549,7 +3549,7 @@ static int atyfb_pci_probe(struct pci_dev *pdev,
/* Reserve space */
res_start = rp->start;
res_size = resource_size(rp);
- if (!pcim_request_region(pdev, rp - pdev->resource, "atyfb"))
+ if (pcim_request_region(pdev, rp - pdev->resource, "atyfb"))
return -EBUSY;
/* Allocate framebuffer */
--
2.43.0