* [PATCH 5/8] atyfb: Honor the return value of pci_register_driver
@ 2006-08-10 11:51 Antonino A. Daplas
2006-08-10 12:11 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Antonino A. Daplas @ 2006-08-10 11:51 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Fbdev development list
Do not ignore the return value of pci_register_driver().
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 5/8] atyfb: Honor the return value of pci_register_driver
2006-08-10 11:51 [PATCH 5/8] atyfb: Honor the return value of pci_register_driver Antonino A. Daplas
@ 2006-08-10 12:11 ` Geert Uytterhoeven
2006-08-10 12:30 ` Antonino A. Daplas
2006-08-10 12:56 ` [PATCH 5/8 RESEND] " Antonino A. Daplas
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2006-08-10 12:11 UTC (permalink / raw)
To: Linux Fbdev development list; +Cc: Andrew Morton
On Thu, 10 Aug 2006, Antonino A. Daplas wrote:
> Do not ignore the return value of pci_register_driver().
>
> Signed-off-by: Antonino Daplas <adaplas@pol.net>
> ---
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/8] atyfb: Honor the return value of pci_register_driver
2006-08-10 12:11 ` Geert Uytterhoeven
@ 2006-08-10 12:30 ` Antonino A. Daplas
2006-08-10 12:45 ` Geert Uytterhoeven
2006-08-10 12:56 ` [PATCH 5/8 RESEND] " Antonino A. Daplas
1 sibling, 1 reply; 5+ messages in thread
From: Antonino A. Daplas @ 2006-08-10 12:30 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Andrew Morton, Geert Uytterhoeven
Check return value of pci_register_driver().
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 5/8] atyfb: Honor the return value of pci_register_driver
2006-08-10 12:30 ` Antonino A. Daplas
@ 2006-08-10 12:45 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2006-08-10 12:45 UTC (permalink / raw)
To: Antonino A. Daplas; +Cc: Andrew Morton, Linux Frame Buffer Device Development
On Thu, 10 Aug 2006, Antonino A. Daplas wrote:
> Check return value of pci_register_driver().
>
> Signed-off-by: Antonino Daplas <adaplas@pol.net>
> ---
> 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?
Looks better.
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/8 RESEND] atyfb: Honor the return value of pci_register_driver
2006-08-10 12:11 ` Geert Uytterhoeven
2006-08-10 12:30 ` Antonino A. Daplas
@ 2006-08-10 12:56 ` Antonino A. Daplas
1 sibling, 0 replies; 5+ messages in thread
From: Antonino A. Daplas @ 2006-08-10 12:56 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Andrew Morton, Geert Uytterhoeven
Check return value of pci_register_driver().
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-08-10 12:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-10 11:51 [PATCH 5/8] atyfb: Honor the return value of pci_register_driver Antonino A. Daplas
2006-08-10 12:11 ` Geert Uytterhoeven
2006-08-10 12:30 ` Antonino A. Daplas
2006-08-10 12:45 ` Geert Uytterhoeven
2006-08-10 12:56 ` [PATCH 5/8 RESEND] " Antonino A. Daplas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).