dev
size
This call is used only by SPI master controller drivers, which are the only ones directly touching chip registers. It's how they allocate an spi_master structure, prior to calling spi_register_master.
This must be called from context that can sleep. It returns the SPI master structure on success, else NULL.
The caller is responsible for assigning the bus number and initializing the master's methods before calling spi_register_master; and (after errors adding the device) calling spi_master_put to prevent a memory leak.