aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-06-26 00:26:33 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 09:58:29 -0700
commit103edf024b98ff6a1feef9c43886f39b00c5753d (patch)
tree14abaa9b44a47fd013c10f067d20dd165c0198ca
parent673681c1b575a73159606ae3c4498de851596489 (diff)
[PATCH] vesafb: Update platform code
Update platform code to dynamically allocate the platform device Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/video/vesafb.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index b0b9acfdd43..2fbaa8484f8 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -460,9 +460,7 @@ static struct platform_driver vesafb_driver = {
},
};
-static struct platform_device vesafb_device = {
- .name = "vesafb",
-};
+static struct platform_device *vesafb_device;
static int __init vesafb_init(void)
{
@@ -475,10 +473,19 @@ static int __init vesafb_init(void)
ret = platform_driver_register(&vesafb_driver);
if (!ret) {
- ret = platform_device_register(&vesafb_device);
- if (ret)
+ vesafb_device = platform_device_alloc("vesafb", 0);
+
+ if (vesafb_device)
+ ret = platform_device_add(vesafb_device);
+ else
+ ret = -ENOMEM;
+
+ if (ret) {
+ platform_device_put(vesafb_device);
platform_driver_unregister(&vesafb_driver);
+ }
}
+
return ret;
}
module_init(vesafb_init);