From 76f46b561974865b1a3abc553ec56c95ee34f9fb Mon Sep 17 00:00:00 2001 From: Hubert Feurstein Date: Mon, 20 Jun 2011 23:46:32 +0200 Subject: [PATCH] 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 Signed-off-by: Sascha Hauer --- drivers/spi/spi.c | 1 + include/spi/spi.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 45602597a..588c2633f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -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); diff --git a/include/spi/spi.h b/include/spi/spi.h index 8dce8dbd2..c76f3b792 100644 --- a/include/spi/spi.h +++ b/include/spi/spi.h @@ -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; }; /**