Skip to content

Commit 103ccee

Browse files
nvswarrenbroonie
authored andcommitted
spi: revert master->setup function removal for altera and nuc900
Commit 24778be "spi: convert drivers to use bits_per_word_mask" removed what appeared to be redundant code from many drivers. However, it appears that in the spi-bitbang case, these functions are required by the spi-bitbang core, even if they don't do anything. Restore them. For 3.12, the spi-bitbang core should be adjusted not to require these callbacks to exist if they don't need to do anything. This is the equivalent of Michal Simek's patch "spi/xilinx: Revert master->setup function removal", applied to other affected drivers. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent ed89355 commit 103ccee

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

drivers/spi/spi-altera.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ static void altera_spi_chipsel(struct spi_device *spi, int value)
103103
}
104104
}
105105

106+
static int altera_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
107+
{
108+
return 0;
109+
}
110+
111+
static int altera_spi_setup(struct spi_device *spi)
112+
{
113+
return 0;
114+
}
115+
106116
static inline unsigned int hw_txbyte(struct altera_spi *hw, int count)
107117
{
108118
if (hw->tx) {
@@ -221,6 +231,7 @@ static int altera_spi_probe(struct platform_device *pdev)
221231
master->bus_num = pdev->id;
222232
master->num_chipselect = 16;
223233
master->mode_bits = SPI_CS_HIGH;
234+
master->setup = altera_spi_setup;
224235

225236
hw = spi_master_get_devdata(master);
226237
platform_set_drvdata(pdev, hw);
@@ -229,6 +240,7 @@ static int altera_spi_probe(struct platform_device *pdev)
229240
hw->bitbang.master = spi_master_get(master);
230241
if (!hw->bitbang.master)
231242
return err;
243+
hw->bitbang.setup_transfer = altera_spi_setupxfer;
232244
hw->bitbang.chipselect = altera_spi_chipsel;
233245
hw->bitbang.txrx_bufs = altera_spi_txrx;
234246

drivers/spi/spi-nuc900.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ static void nuc900_spi_gobusy(struct nuc900_spi *hw)
174174
spin_unlock_irqrestore(&hw->lock, flags);
175175
}
176176

177+
static int nuc900_spi_setupxfer(struct spi_device *spi,
178+
struct spi_transfer *t)
179+
{
180+
return 0;
181+
}
182+
183+
static int nuc900_spi_setup(struct spi_device *spi)
184+
{
185+
return 0;
186+
}
187+
177188
static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count)
178189
{
179190
return hw->tx ? hw->tx[count] : 0;
@@ -366,8 +377,10 @@ static int nuc900_spi_probe(struct platform_device *pdev)
366377
master->num_chipselect = hw->pdata->num_cs;
367378
master->bus_num = hw->pdata->bus_num;
368379
hw->bitbang.master = hw->master;
380+
hw->bitbang.setup_transfer = nuc900_spi_setupxfer;
369381
hw->bitbang.chipselect = nuc900_spi_chipsel;
370382
hw->bitbang.txrx_bufs = nuc900_spi_txrx;
383+
hw->bitbang.master->setup = nuc900_spi_setup;
371384

372385
hw->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
373386
if (hw->res == NULL) {

0 commit comments

Comments
 (0)