mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] power: ab8500_btemp: use builtin_platform_driver
@ 2016-11-23 14:56 Geliang Tang
  2016-11-23 15:47 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2016-11-23 14:56 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Geliang Tang, linux-pm, linux-kernel

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

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");
-- 
2.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: ab8500_btemp: use builtin_platform_driver
  2016-11-23 14:56 [PATCH] power: ab8500_btemp: use builtin_platform_driver Geliang Tang
@ 2016-11-23 15:47 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2016-11-23 15:47 UTC (permalink / raw)
  To: Geliang Tang; +Cc: linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-23 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23 14:56 [PATCH] power: ab8500_btemp: use builtin_platform_driver Geliang Tang
2016-11-23 15:47 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®