Skip to contentSkip to conversation

vesafb: Update platform code

PATCH In review Antonino A. Daplas 1 participant 1 message Apr 29, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 7/12 vesafb: Update platform code

Update platform code to dynamically allocate the platform device

---

 drivers/video/vesafb.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
drivers/video/vesafb.c +12 -5
index b0b9acf..2fbaa84 100644
@@ -460,9 +460,7 @@ static struct platform_driver vesafb_dri
 	},
 };
 
-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);

-------------------------------------------------------
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