mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[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>
This commit is contained in:
parent
673681c1b5
commit
103edf024b
1 changed files with 12 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue