diff options
author | Kunihiko Hayashi <hayashi.kunihiko@socionext.com> | 2023-08-07 03:16:21 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-08-08 15:59:26 +0300 |
commit | 2ca03ecc9c8556e913aef6f381154721dec4e44b (patch) | |
tree | 24b9a244d03d18c1e5cf9ccd37cc4c9356db8f63 | |
parent | f9a798867b15b906aa0637d8efb8f6d7ed188291 (diff) | |
download | linux-2ca03ecc9c8556e913aef6f381154721dec4e44b.tar.xz |
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 <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20230807001621.196776-1-hayashi.kunihiko@socionext.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-dw-mmio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 3a31ad74a538..9e041a28ed47 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -369,7 +369,9 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) dws->max_freq = clk_get_rate(dwsmmio->clk); - device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width); + if (device_property_read_u32(&pdev->dev, "reg-io-width", + &dws->reg_io_width)) + dws->reg_io_width = 4; num_cs = 4; |