From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v4 1/2] mci: provide wrapper for mci_get_device_by_name ∘ devpath_to_name
Date: Mon, 9 Sep 2019 22:34:50 +0200 [thread overview]
Message-ID: <20190909203451.13047-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20190909203451.13047-1-u.kleine-koenig@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.23.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-09-09 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 20:34 [PATCH v4 0/2] simplify setting enhanced area of mmc devices Uwe Kleine-König
2019-09-09 20:34 ` Uwe Kleine-König [this message]
2019-09-09 20:34 ` [PATCH v4 2/2] mci: implement command to switch a mmc device to enhanced mode Uwe Kleine-König
2019-09-12 6:16 ` Sascha Hauer
2019-09-12 6:42 ` Uwe Kleine-König
2019-09-12 6:47 ` 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=20190909203451.13047-2-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