diff mbox

power: ab8500_btemp: use builtin_platform_driver

Message ID e9ca1fc1443a01e115a7603b7c6584dc3235fd76.1479912980.git.geliangtang@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Geliang Tang Nov. 23, 2016, 2:56 p.m. UTC
Use builtin_platform_driver() helper to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/power/supply/ab8500_btemp.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Sebastian Reichel Nov. 23, 2016, 3:47 p.m. UTC | #1
Hi,

On Wed, Nov 23, 2016 at 10:56:52PM +0800, Geliang Tang wrote:
> Use builtin_platform_driver() helper to simplify the code.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
>
> [...]
>
> +builtin_platform_driver(ab8500_btemp_driver);
>  module_exit(ab8500_btemp_exit);

builtin_XYZ() followed by module_XYZ() is obviously wrong. I think
the driver could be made tristate, so lets do that (and then use
module_platform_driver() instead).

-- Sebastian
diff mbox

Patch

diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
index 6ffdc18..f925e50 100644
--- a/drivers/power/supply/ab8500_btemp.c
+++ b/drivers/power/supply/ab8500_btemp.c
@@ -1193,17 +1193,12 @@  static struct platform_driver ab8500_btemp_driver = {
 	},
 };
 
-static int __init ab8500_btemp_init(void)
-{
-	return platform_driver_register(&ab8500_btemp_driver);
-}
-
 static void __exit ab8500_btemp_exit(void)
 {
 	platform_driver_unregister(&ab8500_btemp_driver);
 }
 
-device_initcall(ab8500_btemp_init);
+builtin_platform_driver(ab8500_btemp_driver);
 module_exit(ab8500_btemp_exit);
 
 MODULE_LICENSE("GPL v2");