Skip to content

Commit 98d75b9

Browse files
fancerbroonie
authored andcommitted
spi: dw: Drop default number of CS setting
DW APB/AHB SSI core now supports the procedure automatically detecting the number of native chip-select lines. Thus there is no longer point in defaulting to four CS if the platform doesn't specify the real number especially seeing the default number didn't correspond to any original DW APB/AHB databook. 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 33c8597 commit 98d75b9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/spi/spi-dw-mmio.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
320320
struct resource *mem;
321321
struct dw_spi *dws;
322322
int ret;
323-
int num_cs;
324323

325324
dwsmmio = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_mmio),
326325
GFP_KERNEL);
@@ -364,11 +363,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
364363
&dws->reg_io_width))
365364
dws->reg_io_width = 4;
366365

367-
num_cs = 4;
368-
369-
device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
370-
371-
dws->num_cs = num_cs;
366+
/* Rely on the auto-detection if no property specified */
367+
device_property_read_u32(&pdev->dev, "num-cs", &dws->num_cs);
372368

373369
init_func = device_get_match_data(&pdev->dev);
374370
if (init_func) {

0 commit comments

Comments
 (0)