Skip to content

Commit 2ca03ec

Browse files
khayash1broonie
authored andcommitted
spi: dw: Set default value if reg-io-width isn't specified
According to the dt-bindings, the default value of reg-io-width is 4. However, the value becomes zero when reg-io-width isn't specified. Should set the actual value to dws->reg_io_width, considering it referenced. Signed-off-by: Kunihiko Hayashi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f9a7988 commit 2ca03ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/spi/spi-dw-mmio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
369369

370370
dws->max_freq = clk_get_rate(dwsmmio->clk);
371371

372-
device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width);
372+
if (device_property_read_u32(&pdev->dev, "reg-io-width",
373+
&dws->reg_io_width))
374+
dws->reg_io_width = 4;
373375

374376
num_cs = 4;
375377

0 commit comments

Comments
 (0)