[PATCH] pinctrl: zynq: use module_platform_driver to simplify the code
Srinivas Neeli
srinivas.neeli at xilinx.com
Wed Feb 23 20:36:05 PST 2022
module_platform_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Srinivas Neeli <srinivas.neeli at xilinx.com>
---
drivers/pinctrl/pinctrl-zynq.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index a96af8a76a7a..0e8de27d0de8 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -8,6 +8,7 @@
*/
#include <linux/io.h>
#include <linux/mfd/syscon.h>
+#include <linux/module.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -1210,8 +1211,4 @@ static struct platform_driver zynq_pinctrl_driver = {
.probe = zynq_pinctrl_probe,
};
-static int __init zynq_pinctrl_init(void)
-{
- return platform_driver_register(&zynq_pinctrl_driver);
-}
-arch_initcall(zynq_pinctrl_init);
+module_platform_driver(zynq_pinctrl_driver);
--
2.17.1
More information about the linux-arm-kernel
mailing list