From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v3 1/2] mci: provide wrapper for mci_get_device_by_name ∘ devpath_to_name
Date: Mon, 8 Oct 2018 10:29:20 +0200 [thread overview]
Message-ID: <20181008082921.26922-1-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20181008074936.7ilxnbq7sc5mphbu@pengutronix.de>
Also convert the only user of mci_get_device_by_name to this new
wrapper.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
commands/mmc_extcsd.c | 6 +++---
include/mci.h | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 889a6c614a47..55decd618553 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -2366,7 +2366,7 @@ static int do_mmc_extcsd(int argc, char *argv[])
u8 *dst;
int retval = 0;
int opt;
- char *devname;
+ char *devpath;
int index = 0;
int value = 0;
int write_operation = 0;
@@ -2404,9 +2404,9 @@ static int do_mmc_extcsd(int argc, char *argv[])
if (optind == argc)
return COMMAND_ERROR_USAGE;
- devname = argv[optind];
+ devpath = argv[optind];
- mci = mci_get_device_by_name(devpath_to_name(devname));
+ mci = mci_get_device_by_devpath(devpath);
if (mci == NULL) {
retval = -ENOENT;
goto error;
diff --git a/include/mci.h b/include/mci.h
index 072008ef9da7..5d0c2f8f9638 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -28,6 +28,7 @@
#include <linux/list.h>
#include <block.h>
+#include <fs.h>
#include <regulator.h>
/* These codes should be sorted numerically in order of newness. If the last
@@ -490,4 +491,9 @@ static inline int mmc_host_is_spi(struct mci_host *host)
struct mci *mci_get_device_by_name(const char *name);
+static inline struct mci *mci_get_device_by_devpath(const char *devpath)
+{
+ return mci_get_device_by_name(devpath_to_name(devpath));
+}
+
#endif /* _MCI_H_ */
--
2.19.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-10-08 8:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 13:28 [PATCH v2 1/2] mci: drop unused parameter from mci_switch() Uwe Kleine-König
2018-01-19 13:28 ` [PATCH v2 2/2] mci: implement command to switch a mmc device to enhanced mode Uwe Kleine-König
2018-01-22 8:12 ` Sascha Hauer
2018-10-02 8:33 ` Uwe Kleine-König
2018-10-08 7:49 ` Sascha Hauer
2018-10-08 8:29 ` Uwe Kleine-König [this message]
2018-10-08 8:29 ` [PATCH v3 " Uwe Kleine-König
2018-10-10 6:44 ` Sascha Hauer
2018-10-02 9:03 ` [PATCH v2] " Uwe Kleine-König
2018-01-22 8:48 ` [PATCH v2 1/2] mci: drop unused parameter from mci_switch() 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=20181008082921.26922-1-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--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