* [PATCH] vesafb: use platform_driver_probe() instead of platform_driver_register()
@ 2010-03-26 16:48 Jan Beulich
2010-03-27 14:18 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2010-03-26 16:48 UTC (permalink / raw)
To: u.kleine-koenig, gregkh; +Cc: linux-kernel
Commit c2e13037e6794bd0d9de3f9ecabf5615f15c160b introduced a huge
amount of section mismatch warnings in vesafb code. Rather than
converting all of the annotations, do the obvious and revert the
__init -> __devinit change, and use the recommended (in that patch)
alternative to calling platform_driver_register(): vesafb depends on
information obtained from by kernel at boot time, cannot be a module,
and no post-boot devices can ever show up.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
drivers/video/vesafb.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
--- linux-2.6.34-rc2/drivers/video/vesafb.c
+++ 2.6.34-rc2-vesafb-init/drivers/video/vesafb.c
@@ -226,7 +226,7 @@ static int __init vesafb_setup(char *opt
return 0;
}
-static int __devinit vesafb_probe(struct platform_device *dev)
+static int __init vesafb_probe(struct platform_device *dev)
{
struct fb_info *info;
int i, err;
@@ -477,7 +477,6 @@ err:
}
static struct platform_driver vesafb_driver = {
- .probe = vesafb_probe,
.driver = {
.name = "vesafb",
},
@@ -493,20 +492,21 @@ static int __init vesafb_init(void)
/* ignore error return of fb_get_options */
fb_get_options("vesafb", &option);
vesafb_setup(option);
- ret = platform_driver_register(&vesafb_driver);
+ vesafb_device = platform_device_alloc("vesafb", 0);
+ if (!vesafb_device)
+ return -ENOMEM;
+
+ ret = platform_device_add(vesafb_device);
if (!ret) {
- vesafb_device = platform_device_alloc("vesafb", 0);
+ ret = platform_driver_probe(&vesafb_driver, vesafb_probe);
+ if (ret)
+ platform_device_del(vesafb_device);
+ }
- if (vesafb_device)
- ret = platform_device_add(vesafb_device);
- else
- ret = -ENOMEM;
-
- if (ret) {
- platform_device_put(vesafb_device);
- platform_driver_unregister(&vesafb_driver);
- }
+ if (ret) {
+ platform_device_put(vesafb_device);
+ vesafb_device = NULL;
}
return ret;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] vesafb: use platform_driver_probe() instead of platform_driver_register()
2010-03-26 16:48 [PATCH] vesafb: use platform_driver_probe() instead of platform_driver_register() Jan Beulich
@ 2010-03-27 14:18 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2010-03-27 14:18 UTC (permalink / raw)
To: Jan Beulich; +Cc: gregkh, linux-kernel
Hello Jan,
On Fri, Mar 26, 2010 at 04:48:33PM +0000, Jan Beulich wrote:
> Commit c2e13037e6794bd0d9de3f9ecabf5615f15c160b introduced a huge
> amount of section mismatch warnings in vesafb code. Rather than
> converting all of the annotations, do the obvious and revert the
> __init -> __devinit change, and use the recommended (in that patch)
> alternative to calling platform_driver_register(): vesafb depends on
> information obtained from by kernel at boot time, cannot be a module,
> and no post-boot devices can ever show up.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
Looks good, Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-27 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-26 16:48 [PATCH] vesafb: use platform_driver_probe() instead of platform_driver_register() Jan Beulich
2010-03-27 14:18 ` Uwe Kleine-König
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).