Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f3fd895 authored by Enrico Weigelt's avatar Enrico Weigelt Committed by Linus Walleij
Browse files

siox: Add helper macro to simplify driver registration



Add more helper macros for trivial driver init cases, similar to the
already existing module_platform_driver() or module_i2c_driver().

This helps to reduce driver init boilerplate.

Signed-off-by: default avatarEnrico Weigelt <info@metux.net>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 0f5cb8cc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -75,3 +75,13 @@ static inline void siox_driver_unregister(struct siox_driver *sdriver)
{
	return driver_unregister(&sdriver->driver);
}

/*
 * module_siox_driver() - Helper macro for drivers that don't do
 * anything special in module init/exit.  This eliminates a lot of
 * boilerplate.  Each module may only use this macro once, and
 * calling it replaces module_init() and module_exit()
 */
#define module_siox_driver(__siox_driver) \
	module_driver(__siox_driver, siox_driver_register, \
			siox_driver_unregister)