mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: dw: Set default value if reg-io-width isn't specified
@ 2023-08-07  0:16 Kunihiko Hayashi
  2023-08-07 22:57 ` Serge Semin
  2023-08-08 15:34 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2023-08-07  0:16 UTC (permalink / raw)
  To: Serge Semin, Mark Brown; +Cc: linux-spi, linux-kernel, Kunihiko Hayashi

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>
---
 drivers/spi/spi-dw-mmio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index a963bc96c223..7eafc07ef7aa 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;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-08 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07  0:16 [PATCH] spi: dw: Set default value if reg-io-width isn't specified Kunihiko Hayashi
2023-08-07 22:57 ` Serge Semin
2023-08-08  0:00   ` Kunihiko Hayashi
2023-08-08 12:46     ` Mark Brown
2023-08-08 20:59       ` Serge Semin
2023-08-08 15:34 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®