Commit 103edf02 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] vesafb: Update platform code

Update platform code to dynamically allocate the platform device
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 673681c1
...@@ -460,9 +460,7 @@ static struct platform_driver vesafb_driver = { ...@@ -460,9 +460,7 @@ static struct platform_driver vesafb_driver = {
}, },
}; };
static struct platform_device vesafb_device = { static struct platform_device *vesafb_device;
.name = "vesafb",
};
static int __init vesafb_init(void) static int __init vesafb_init(void)
{ {
...@@ -475,10 +473,19 @@ static int __init vesafb_init(void) ...@@ -475,10 +473,19 @@ static int __init vesafb_init(void)
ret = platform_driver_register(&vesafb_driver); ret = platform_driver_register(&vesafb_driver);
if (!ret) { if (!ret) {
ret = platform_device_register(&vesafb_device); vesafb_device = platform_device_alloc("vesafb", 0);
if (ret)
if (vesafb_device)
ret = platform_device_add(vesafb_device);
else
ret = -ENOMEM;
if (ret) {
platform_device_put(vesafb_device);
platform_driver_unregister(&vesafb_driver); platform_driver_unregister(&vesafb_driver);
}
} }
return ret; return ret;
} }
module_init(vesafb_init); module_init(vesafb_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment