[2/3] drivers: gpio: pcf857x: use subsys_spi_driver()
diff mbox series

Message ID 1560796840-18207-2-git-send-email-info@metux.net
State New, archived
Headers show
Series
  • [1/3] include: linux: spi: more helpers for declaring spi drivers
Related show

Commit Message

Enrico Weigelt, metux IT consult June 17, 2019, 6:40 p.m. UTC
From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_spi_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-max7301.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Geert Uytterhoeven June 18, 2019, 1:48 p.m. UTC | #1
Hi Enrico,

On Mon, Jun 17, 2019 at 8:41 PM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:
> From: Enrico Weigelt <info@metux.net>
>
> Reduce driver init boilerplate by using the new
> subsys_spi_driver() macro.
>
> Signed-off-by: Enrico Weigelt <info@metux.net>

Thanks for your patch!

>  drivers/gpio/gpio-max7301.c | 13 +------------

s/pcf857x/max7301/ in subject.

Gr{oetje,eeting}s,

                        Geert

Patch
diff mbox series

diff --git a/drivers/gpio/gpio-max7301.c b/drivers/gpio/gpio-max7301.c
index 647dfbb..30815cf 100644
--- a/drivers/gpio/gpio-max7301.c
+++ b/drivers/gpio/gpio-max7301.c
@@ -86,21 +86,10 @@  static int max7301_remove(struct spi_device *spi)
 	.remove = max7301_remove,
 	.id_table = max7301_id,
 };
-
-static int __init max7301_init(void)
-{
-	return spi_register_driver(&max7301_driver);
-}
 /* register after spi postcore initcall and before
  * subsys initcalls that may rely on these GPIOs
  */
-subsys_initcall(max7301_init);
-
-static void __exit max7301_exit(void)
-{
-	spi_unregister_driver(&max7301_driver);
-}
-module_exit(max7301_exit);
+subsys_spi_driver(max7301_driver);
 
 MODULE_AUTHOR("Juergen Beisert, Wolfram Sang");
 MODULE_LICENSE("GPL v2");