From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: mfe@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/3] mci: core: add broken_cd device parameter
Date: Fri, 30 Sep 2022 17:33:16 +0200 [thread overview]
Message-ID: <20220930153317.731088-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220930153317.731088-1-a.fatoum@pengutronix.de>
Sometimes a broken card-detect is not a general issue affecting all
boards, but only a given board. Allow setting broken_cd for such boards
via a device parameter.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
- replace Kconfig option with device parameter (Marco, Sascha)
---
drivers/mci/mci-core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 5f4457bab3df..26b524007609 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1919,7 +1919,7 @@ int mci_register(struct mci_host *host)
{
struct mci *mci;
struct device_d *hw_dev;
- struct param_d *param_probe;
+ struct param_d *param_probe, *param_broken_cd;
int ret;
mci = xzalloc(sizeof(*mci));
@@ -1973,6 +1973,15 @@ int mci_register(struct mci_host *host)
goto err_unregister;
}
+ param_broken_cd = dev_add_param_bool(&mci->dev, "broken_cd",
+ NULL, NULL, &host->broken_cd, mci);
+
+ if (IS_ERR(param_broken_cd) && PTR_ERR(param_broken_cd) != -ENOSYS) {
+ ret = PTR_ERR(param_broken_cd);
+ dev_dbg(&mci->dev, "Failed to add 'broken_cd' parameter to the MCI device\n");
+ goto err_unregister;
+ }
+
if (IS_ENABLED(CONFIG_MCI_INFO))
mci->dev.info = mci_info;
--
2.30.2
next prev parent reply other threads:[~2022-09-30 15:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 15:33 [PATCH v2 1/3] mci: core: act upon broken-cd device tree property Ahmad Fatoum
2022-09-30 15:33 ` Ahmad Fatoum [this message]
2022-09-30 15:33 ` [PATCH v2 3/3] mci: core: fixup broken-cd information into kernel DT Ahmad Fatoum
2022-09-30 16:22 ` [PATCH v2 1/3] mci: core: act upon broken-cd device tree property Ahmad Fatoum
2022-10-04 8:53 ` 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=20220930153317.731088-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mfe@pengutronix.de \
/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