From: David Brownell Address some comments from Randy Dunlap; add kerneldoc for driver register/unregister functions. Signed-off-by: David Brownell Cc: "Randy.Dunlap" Signed-off-by: Andrew Morton --- Documentation/DocBook/kernel-api.tmpl | 2 +- drivers/spi/spi.c | 7 +++++++ include/linux/spi/spi.h | 21 +++++++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-) diff -puN Documentation/DocBook/kernel-api.tmpl~spi-kerneldoc-fix Documentation/DocBook/kernel-api.tmpl --- a/Documentation/DocBook/kernel-api.tmpl~spi-kerneldoc-fix +++ a/Documentation/DocBook/kernel-api.tmpl @@ -636,7 +636,7 @@ X!Idrivers/video/console/fonts.c objects, each of which wraps a full duplex SPI transfer. A variety of protocol tweaking options are needed, because different chips adopt very different policies for how they - use the bits tranferred with SPI. + use the bits transferred with SPI. !Iinclude/linux/spi/spi.h !Fdrivers/spi/spi.c spi_register_board_info diff -puN drivers/spi/spi.c~spi-kerneldoc-fix drivers/spi/spi.c --- a/drivers/spi/spi.c~spi-kerneldoc-fix +++ a/drivers/spi/spi.c @@ -152,6 +152,11 @@ static void spi_drv_shutdown(struct devi sdrv->shutdown(to_spi_device(dev)); } +/** + * spi_register_driver - register a SPI driver + * @sdrv: the driver to register + * Context: can sleep + */ int spi_register_driver(struct spi_driver *sdrv) { sdrv->driver.bus = &spi_bus_type; @@ -187,6 +192,7 @@ static DECLARE_MUTEX(board_lock); * spi_new_device - instantiate one new SPI device * @master: Controller to which device is connected * @chip: Describes the SPI device + * Context: can sleep * * On typical mainboards, this is purely internal; and it's not needed * after board init creates the hard-wired devices. Some development @@ -260,6 +266,7 @@ EXPORT_SYMBOL_GPL(spi_new_device); * spi_register_board_info - register SPI devices for a given board * @info: array of chip descriptors * @n: how many descriptors are provided + * Context: can sleep * * Board-specific early init code calls this (probably during arch_initcall) * with segments of the SPI device table. Any device nodes are created later, diff -puN include/linux/spi/spi.h~spi-kerneldoc-fix include/linux/spi/spi.h --- a/include/linux/spi/spi.h~spi-kerneldoc-fix +++ a/include/linux/spi/spi.h @@ -83,14 +83,14 @@ struct spi_device { const char *modalias; /* - // likely need more hooks for more protocol options affecting how - // the controller talks to each chip, like: - // - memory packing (12 bit samples into low bits, others zeroed) - // - priority - // - drop chipselect after each word - // - chipselect delays - // - ... - */ + * likely need more hooks for more protocol options affecting how + * the controller talks to each chip, like: + * - memory packing (12 bit samples into low bits, others zeroed) + * - priority + * - drop chipselect after each word + * - chipselect delays + * - ... + */ }; static inline struct spi_device *to_spi_device(struct device *dev) @@ -153,6 +153,11 @@ static inline struct spi_driver *to_spi_ extern int spi_register_driver(struct spi_driver *sdrv); +/** + * spi_unregister_driver - reverse effect of spi_register_driver + * @sdrv: the driver to unregister + * Context: can sleep + */ static inline void spi_unregister_driver(struct spi_driver *sdrv) { if (sdrv) _