Skip to content

Commit 77810d4

Browse files
fancerbroonie
authored andcommitted
spi: dw: Initialize paddr in DW SPI MMIO private data
This field is used only for the DW SPI DMA code initialization, that's why there were no problems with it being uninitialized in Dw SPI MMIO driver. Since in a further patch we are going to introduce the DW SPI DMA support in the MMIO version of the driver, lets set the field with the physical address of the DW SPI controller registers region. Co-developed-by: Georgy Vlasov <[email protected]> Co-developed-by: Ramil Zaripov <[email protected]> Signed-off-by: Georgy Vlasov <[email protected]> Signed-off-by: Ramil Zaripov <[email protected]> Signed-off-by: Serge Semin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9aea644 commit 77810d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/spi/spi-dw-mmio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
184184
int (*init_func)(struct platform_device *pdev,
185185
struct dw_spi_mmio *dwsmmio);
186186
struct dw_spi_mmio *dwsmmio;
187+
struct resource *mem;
187188
struct dw_spi *dws;
188189
int ret;
189190
int num_cs;
@@ -196,10 +197,12 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
196197
dws = &dwsmmio->dws;
197198

198199
/* Get basic io resource and map it */
199-
dws->regs = devm_platform_ioremap_resource(pdev, 0);
200+
dws->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
200201
if (IS_ERR(dws->regs))
201202
return PTR_ERR(dws->regs);
202203

204+
dws->paddr = mem->start;
205+
203206
dws->irq = platform_get_irq(pdev, 0);
204207
if (dws->irq < 0)
205208
return dws->irq; /* -ENXIO */

0 commit comments

Comments
 (0)