From: Denzeel Oliva <wachiturroxd150@gmail.com>
To: andi.shyti@kernel.org, broonie@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, alim.akhtar@samsung.com,
linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Denzeel Oliva <wachiturroxd150@gmail.com>
Subject: [PATCH v3 2/3] spi: s3c64xx: prioritize fifo-depth from DT over port_config
Date: Fri, 14 Feb 2025 04:33:42 +0000 [thread overview]
Message-ID: <20250214043343.263-3-wachiturroxd150@gmail.com> (raw)
In-Reply-To: <20250214043343.263-1-wachiturroxd150@gmail.com>
Rearrange s3c64xx_spi_probe() to ensure that the 'fifo-depth' property
from the device tree (DT) is always prioritized over the fallback
values in port_config.
Previously, if port_config had a fifo_depth value, it would override
the DT property. This prevented DT from correctly setting the depth
per node.
This ensures flexibility for device tree configurations while keeping
a safe fallback.
Signed-off-by: Denzeel Oliva <wachiturroxd150@gmail.com>
---
drivers/spi/spi-s3c64xx.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 389275dbc..dae63a105 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1283,11 +1283,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
if (ret)
return ret;
- if (sdd->port_conf->fifo_depth)
- sdd->fifo_depth = sdd->port_conf->fifo_depth;
- else if (of_property_read_u32(pdev->dev.of_node, "fifo-depth",
- &sdd->fifo_depth))
- sdd->fifo_depth = FIFO_DEPTH(sdd);
+ if (of_property_read_u32(pdev->dev.of_node, "fifo-depth",
+ &sdd->fifo_depth)) {
+ if (sdd->port_conf->fifo_depth)
+ sdd->fifo_depth = sdd->port_conf->fifo_depth;
+ else
+ sdd->fifo_depth = FIFO_DEPTH(sdd);
+ }
s3c64xx_spi_set_fifomask(sdd);
--
2.48.1
next prev parent reply other threads:[~2025-02-14 4:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 4:33 [PATCH v3 0/3] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
2025-02-14 4:33 ` [PATCH v3 1/3] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible Denzeel Oliva
2025-02-14 8:16 ` Krzysztof Kozlowski
2025-02-14 15:25 ` Sam Protsenko
2025-02-14 4:33 ` Denzeel Oliva [this message]
2025-02-14 7:10 ` [PATCH v3 2/3] spi: s3c64xx: prioritize fifo-depth from DT over port_config Tudor Ambarus
2025-02-14 4:33 ` [PATCH v3 3/3] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
2025-02-14 5:31 ` [PATCH v3 0/3] " Denzeel Oliva
2025-02-14 6:53 ` Tudor Ambarus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250214043343.263-3-wachiturroxd150@gmail.com \
--to=wachiturroxd150@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=andi.shyti@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox