From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mci: drop unused parameter from mci_switch()
Date: Mon, 22 Jan 2018 09:48:49 +0100 [thread overview]
Message-ID: <20180122084849.h54g77ajaj5rtazg@pengutronix.de> (raw)
In-Reply-To: <20180119132825.26662-1-u.kleine-koenig@pengutronix.de>
On Fri, Jan 19, 2018 at 02:28:24PM +0100, Uwe Kleine-König wrote:
> The SWITCH command has two purposes:
> a) switch the command set
> b) Write to the EXT_CSD register
>
> If the access field (bits [25:24]) in the argument are b00, we're in
> case a), otherwise in b). As mci_switch() always passes
> MMC_SWITCH_MODE_WRITE_BYTE (0b3) in the access field, only case b) is
> relevant here. According to the eMMC specification[1] the command set
> field is ignored in case b) and so the respective parameter (that is
> unused already now) can be dropped.
>
> [1] Embedded Multi-Media Card (e•MMC) Electrical Standard (5.1),
> February 2015; paragraph 6.6.1
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Applied this one.
Sascha
> commands/mmc_extcsd.c | 2 +-
> drivers/mci/mci-core.c | 16 ++++++----------
> include/mci.h | 3 +--
> 3 files changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
> index 7a6d39075da0..acd23a466bcb 100644
> --- a/commands/mmc_extcsd.c
> +++ b/commands/mmc_extcsd.c
> @@ -2357,7 +2357,7 @@ static void write_field(struct mci *mci, u8 *reg, u16 index, u8 value,
> break;
> }
>
> - mci_switch(mci, 0, index, value);
> + mci_switch(mci, index, value);
>
> out:
> return;
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index 07911d43d703..3da96f42aaf9 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -396,8 +396,7 @@ int mci_send_ext_csd(struct mci *mci, char *ext_csd)
> * @param value FIXME
> * @return Transaction status (0 on success)
> */
> -int mci_switch(struct mci *mci, unsigned set, unsigned index,
> - unsigned value)
> +int mci_switch(struct mci *mci, unsigned index, unsigned value)
> {
> struct mci_cmd cmd;
>
> @@ -471,7 +470,7 @@ static int mmc_change_freq(struct mci *mci)
>
> cardtype = mci->ext_csd[EXT_CSD_DEVICE_TYPE] & EXT_CSD_CARD_TYPE_MASK;
>
> - err = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
> + err = mci_switch(mci, EXT_CSD_HS_TIMING, 1);
>
> if (err) {
> dev_dbg(&mci->dev, "MMC frequency changing failed: %d\n", err);
> @@ -1044,9 +1043,7 @@ static int mci_startup_mmc(struct mci *mci)
> * 4bit transfer mode. On success set the corresponding
> * bus width on the host.
> */
> - err = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL,
> - EXT_CSD_BUS_WIDTH,
> - ext_csd_bits[idx]);
> + err = mci_switch(mci, EXT_CSD_BUS_WIDTH, ext_csd_bits[idx]);
> if (err) {
> if (idx == 0)
> dev_warn(&mci->dev, "Changing MMC bus width failed: %d\n", err);
> @@ -1253,8 +1250,7 @@ static int mci_blk_part_switch(struct mci_part *part)
> part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK;
> part_config |= part->part_cfg;
>
> - ret = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL,
> - EXT_CSD_PARTITION_CONFIG, part_config);
> + ret = mci_switch(mci, EXT_CSD_PARTITION_CONFIG, part_config);
> if (ret)
> return ret;
>
> @@ -1568,8 +1564,8 @@ static int mci_set_boot(struct param_d *param, void *priv)
> mci->ext_csd_part_config &= ~(7 << 3);
> mci->ext_csd_part_config |= mci->bootpart << 3;
>
> - return mci_switch(mci, EXT_CSD_CMD_SET_NORMAL,
> - EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config);
> + return mci_switch(mci,
> + EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config);
> }
>
> static const char *mci_boot_names[] = {
> diff --git a/include/mci.h b/include/mci.h
> index d3115e8cc68f..827eecd39f8d 100644
> --- a/include/mci.h
> +++ b/include/mci.h
> @@ -477,8 +477,7 @@ void mci_of_parse(struct mci_host *host);
> void mci_of_parse_node(struct mci_host *host, struct device_node *np);
> int mci_detect_card(struct mci_host *);
> int mci_send_ext_csd(struct mci *mci, char *ext_csd);
> -int mci_switch(struct mci *mci, unsigned set, unsigned index,
> - unsigned value);
> +int mci_switch(struct mci *mci, unsigned index, unsigned value);
>
> static inline int mmc_host_is_spi(struct mci_host *host)
> {
> --
> 2.11.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-01-22 8:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 13:28 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 ` [PATCH v3 1/2] mci: provide wrapper for mci_get_device_by_name ∘ devpath_to_name Uwe Kleine-König
2018-10-08 8:29 ` [PATCH v3 2/2] mci: implement command to switch a mmc device to enhanced mode 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 ` Sascha Hauer [this message]
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=20180122084849.h54g77ajaj5rtazg@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@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