mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Richardsen <jonasrichardsen@emlix.com>
To: barebox@lists.infradead.org
Cc: Jonas Richardsen <jonasrichardsen@emlix.com>
Subject: [PATCH] mci: bcm2835: Set mci host for sdhci
Date: Wed, 22 May 2024 08:15:27 +0200	[thread overview]
Message-ID: <20240522061819.6150-1-jonasrichardsen@emlix.com> (raw)

The pointer `sdhci.mci` is currently not being set for the bcm2835. This
leads to a null pointer dereference for example in `sdhci_wait_idle()`
if the `sdhci_read` function fails or times out.

Set the pointer within the `bcm2835_mci_probe` function. This is
analogous to the behaviour seen in `arasan_sdhci_probe`,
`fsl_esdhc_probe`, `rk_sdhci_probe` and other, similar functions.

Signed-off-by: Jonas Richardsen <jonasrichardsen@emlix.com>
---
 drivers/mci/mci-bcm2835.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c
index 3546cc3a32..7fcf4f905b 100644
--- a/drivers/mci/mci-bcm2835.c
+++ b/drivers/mci/mci-bcm2835.c
@@ -382,6 +382,7 @@ static int bcm2835_mci_probe(struct device *hw_dev)
 	host->hw_dev = hw_dev;
 	host->max_clock = clk_get_rate(clk);
 
+	host->sdhci.mci = &host->mci;
 	host->sdhci.read32 = bcm2835_sdhci_read32;
 	host->sdhci.write32 = bcm2835_sdhci_write32;
 
-- 
2.42.0




             reply	other threads:[~2024-05-22  6:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  6:15 Jonas Richardsen [this message]
2024-05-22  8:08 ` Ahmad Fatoum
2024-05-24 11:43 ` Sascha Hauer

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=20240522061819.6150-1-jonasrichardsen@emlix.com \
    --to=jonasrichardsen@emlix.com \
    --cc=barebox@lists.infradead.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