[PATCH 5/8] atyfb: Honor the return value of pci_register_driver

Subsystems: framebuffer layer, the rest

STALE7305d

5 messages, 2 authors, 2006-08-10 · open the first message on its own page

[PATCH 5/8] atyfb: Honor the return value of pci_register_driver

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2006-08-10 11:58:01

Do not ignore the return value of pci_register_driver().

Signed-off-by: Antonino Daplas <redacted>
---

 drivers/video/aty/atyfb_base.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..605fb7e 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3868,12 +3868,11 @@ #ifndef MODULE
 #endif
 
 #ifdef CONFIG_PCI
-    pci_register_driver(&atyfb_driver);
+    return pci_register_driver(&atyfb_driver);
 #endif
 #ifdef CONFIG_ATARI
-    atyfb_atari_probe();
+    return atyfb_atari_probe();
 #endif
-    return 0;
 }
 
 static void __exit atyfb_exit(void)


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: [PATCH 5/8] atyfb: Honor the return value of pci_register_driver

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2006-08-10 12:11:26

On Thu, 10 Aug 2006, Antonino A. Daplas wrote:
quoted hunk
Do not ignore the return value of pci_register_driver().

Signed-off-by: Antonino Daplas <redacted>
---

 drivers/video/aty/atyfb_base.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..605fb7e 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3868,12 +3868,11 @@ #ifndef MODULE
 #endif
 
 #ifdef CONFIG_PCI
-    pci_register_driver(&atyfb_driver);
+    return pci_register_driver(&atyfb_driver);
 #endif
 #ifdef CONFIG_ATARI
-    atyfb_atari_probe();
+    return atyfb_atari_probe();
 #endif
-    return 0;
 }
Actually it's a bit more complicated, as some Ataris do have PCI (although
currently Atari Hades PCI support is broken).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[PATCH 5/8] atyfb: Honor the return value of pci_register_driver

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2006-08-10 12:31:02

Check return value of pci_register_driver().

Signed-off-by: Antonino Daplas <redacted>
---
Geert Uytterhoeven wrote:
Actually it's a bit more complicated, as some Ataris do have PCI (although
currently Atari Hades PCI support is broken).
How about this?

 drivers/video/aty/atyfb_base.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..3f1bdcd 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3859,6 +3859,7 @@ #endif  /*  MODULE  */
 
 static int __devinit atyfb_init(void)
 {
+    int err = 0;
 #ifndef MODULE
     char *option = NULL;
 
@@ -3868,12 +3869,14 @@ #ifndef MODULE
 #endif
 
 #ifdef CONFIG_PCI
-    pci_register_driver(&atyfb_driver);
+    err = pci_register_driver(&atyfb_driver);
 #endif
 #ifdef CONFIG_ATARI
-    atyfb_atari_probe();
+    if (!err)
+	err = atyfb_atari_probe();
 #endif
-    return 0;
+
+    return err;
 }
 
 static void __exit atyfb_exit(void)

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: [PATCH 5/8] atyfb: Honor the return value of pci_register_driver

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2006-08-10 12:45:32

On Thu, 10 Aug 2006, Antonino A. Daplas wrote:
Check return value of pci_register_driver().

Signed-off-by: Antonino Daplas <redacted>
---
Geert Uytterhoeven wrote:
quoted
Actually it's a bit more complicated, as some Ataris do have PCI (although
currently Atari Hades PCI support is broken).
How about this?
Looks better.
quoted hunk
 drivers/video/aty/atyfb_base.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..3f1bdcd 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3859,6 +3859,7 @@ #endif  /*  MODULE  */
 
 static int __devinit atyfb_init(void)
 {
+    int err = 0;
 #ifndef MODULE
     char *option = NULL;
 
@@ -3868,12 +3869,14 @@ #ifndef MODULE
 #endif
 
 #ifdef CONFIG_PCI
-    pci_register_driver(&atyfb_driver);
+    err = pci_register_driver(&atyfb_driver);
 #endif
 #ifdef CONFIG_ATARI
-    atyfb_atari_probe();
+    if (!err)
+	err = atyfb_atari_probe();
 #endif
-    return 0;
+
+    return err;
 }
 
 static void __exit atyfb_exit(void)
I guess pci_register_driver() failing is a fairly rare and catastrophical
event?

If not, atyfb_atari_probe() should probably continue if pci_register_driver()
failed.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[PATCH 5/8 RESEND] atyfb: Honor the return value of pci_register_driver

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2006-08-10 12:56:25

Check return value of pci_register_driver().

Signed-off-by: Antonino Daplas <redacted>
---
Geert Uytterhoeven wrote:
On Thu, 10 Aug 2006, Antonino A. Daplas wrote:

Actually it's a bit more complicated, as some Ataris do have PCI (although
currently Atari Hades PCI support is broken).
This one may be better.

Tony

 drivers/video/aty/atyfb_base.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..d6be4c7 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3859,6 +3859,7 @@ #endif  /*  MODULE  */
 
 static int __devinit atyfb_init(void)
 {
+    int err1 = 1, err2 = 1;
 #ifndef MODULE
     char *option = NULL;
 
@@ -3868,12 +3869,13 @@ #ifndef MODULE
 #endif
 
 #ifdef CONFIG_PCI
-    pci_register_driver(&atyfb_driver);
+    err1 = pci_register_driver(&atyfb_driver);
 #endif
 #ifdef CONFIG_ATARI
-    atyfb_atari_probe();
+    err2 = atyfb_atari_probe();
 #endif
-    return 0;
+
+    return (err1 && err2) ? -ENODEV : 0;
 }
 
 static void __exit atyfb_exit(void)

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help