Thread (3 messages) 3 messages, 3 authors, 2008-06-04

Re: [PATCH] hgafb: convert to new platform driver API (bugzilla #9689)

flat view

From: Anton Vorontsov <hidden>
Date: 2008-06-04 00:03:29

On Tue, Jun 03, 2008 at 04:13:46PM -0700, Andrew Morton wrote:
[...]
quoted
-	info = framebuffer_alloc(0, NULL);
+	info = framebuffer_alloc(0, &pdev->dev);
(1)

[...]
quoted
 	if (!ret) {
-		ret = platform_device_register(&hgafb_device);
-		if (ret)
-			driver_unregister(&hgafb_driver);
+		hgafb_device = platform_device_register_simple("hgafb", 0, NULL, 0);
+
+		if (IS_ERR(hgafb_device)) {
(2)
quoted
+			platform_driver_unregister(&hgafb_driver);
+			ret = PTR_ERR(hgafb_device);
+		}
 	}
 
 	return ret;
@@ -647,8 +649,8 @@ static int __init hgafb_init(void)
 
 static void __exit hgafb_exit(void)
 {
-	platform_device_unregister(&hgafb_device);
-	driver_unregister(&hgafb_driver);
+	platform_device_unregister(hgafb_device);
+	platform_driver_unregister(&hgafb_driver);
 }
Oh.  I just merged Anton's similar patch, below.

What should we do?
Please drop mine. Krzysztof's patch is better because of (1) and (2).

(1) is nice addition. Plus mine doesn't do (2), i.e. IS_ERR(), thus
might cause troubles in case platform_device_register_simple() return
errors.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help