mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fbdev: atyfb: Fix the pcim_request_region() check
@ 2026-11-29 22:27 Stian Halseth
  0 siblings, 0 replies; only message in thread
From: Stian Halseth @ 2026-11-29 22:27 UTC (permalink / raw)
  To: Helge Deller
  Cc: linux-fbdev, dri-devel, linux-kernel, Shixiong Ou, Stian Halseth, stable

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@vger.kernel.org # 7.3
Signed-off-by: Stian Halseth <stian@itx.no>
---
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 22:27 [PATCH] fbdev: atyfb: Fix the pcim_request_region() check Stian Halseth

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®