9
0
Fork 0

spi: add platform_data pointer to spi_board_info

In the spi layer this pointer will be assigned to the
platform_data pointer of the new spi device, thus it can
be accessed in the drivers 'probe' handler.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Hubert Feurstein 2011-06-20 23:46:32 +02:00 committed by Sascha Hauer
parent 6d78fe87dc
commit 76f46b5619
2 changed files with 3 additions and 2 deletions

View File

@ -75,6 +75,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
proxy->chip_select = chip->chip_select;
proxy->max_speed_hz = chip->max_speed_hz;
proxy->mode = chip->mode;
proxy->dev.platform_data = chip->platform_data;
strcpy(proxy->dev.name, chip->name);
proxy->dev.type_data = proxy;
status = register_device(&proxy->dev);

View File

@ -14,8 +14,8 @@ struct spi_board_info {
/* mode becomes spi_device.mode, and is essential for chips
* where the default of SPI_CS_HIGH = 0 is wrong.
*/
u8 mode;
u8 mode;
void *platform_data;
};
/**