SPI slave device creation by SPI framework
After the board driver and PCI driver have registered flash information (SPI slave device information) and have created and registered the SPI master, the SPI framework creates slave SPI devices. The slave SPI devices are represented by struct spi_device.
During spi_register_master execution, the SPI framework checks if there is any SPI slave device that is hooked to the same bus number registered by the SPI master. If such a device is found, the SPI framework creates slave SPI devices and registers those devices with the device subsystem. This is done by a call to spi_match_master_to_boardinfo() function (from spi_register_master function).
SPI slave devices can be created by the SPI framework in the following way: