mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 01/12] mci: imx-esdhc: Drop unnecessary type conversion
Date: Mon,  2 Dec 2019 07:19:43 -0800	[thread overview]
Message-ID: <20191202151954.16032-2-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20191202151954.16032-1-andrew.smirnov@gmail.com>

Nether esdhc_setup_data() nor esdhc_do_data() really need struct
mci_host, so we can drop a bit of extra type conversion code by
changing their signature to accept struct fsl_esdhc_host instead

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/mci/imx-esdhc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index bebc36d0b..7d12df2b8 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -164,10 +164,9 @@ static inline void esdhc_setbits32(struct fsl_esdhc_host *host, unsigned int reg
 	esdhc_clrsetbits32(host, reg, 0, set);
 }
 
-static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data,
+static int esdhc_setup_data(struct fsl_esdhc_host *host, struct mci_data *data,
 			    dma_addr_t dma)
 {
-	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
 	u32 wml_value;
 
 	if (!IS_ENABLED(CONFIG_MCI_IMX_ESDHC_PIO)) {
@@ -193,9 +192,8 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data,
 	return 0;
 }
 
-static int esdhc_do_data(struct mci_host *mci, struct mci_data *data)
+static int esdhc_do_data(struct fsl_esdhc_host *host, struct mci_data *data)
 {
-	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
 	u32 irqstat;
 
 	if (IS_ENABLED(CONFIG_MCI_IMX_ESDHC_PIO))
@@ -256,7 +254,7 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
 				return -EFAULT;
 		}
 
-		err = esdhc_setup_data(mci, data, dma);
+		err = esdhc_setup_data(host, data, dma);
 		if(err)
 			return err;
 	}
@@ -319,7 +317,7 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
 
 	/* Wait until all of the blocks are transferred */
 	if (data) {
-		ret = esdhc_do_data(mci, data);
+		ret = esdhc_do_data(host, data);
 		if (ret)
 			return ret;
 
-- 
2.21.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-12-02 15:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 15:19 [PATCH 00/12] Share i.MX ESDHC PBL and PIO code Andrey Smirnov
2019-12-02 15:19 ` Andrey Smirnov [this message]
2019-12-02 15:19 ` [PATCH 02/12] mci: imx-esdhc: Drop unused type definition Andrey Smirnov
2019-12-02 15:19 ` [PATCH 03/12] mci: imx-esdhc: Drop extra helper varaible Andrey Smirnov
2019-12-02 15:19 ` [PATCH 04/12] mci: imx-esdhc-pbl: Don't setup DMA registers Andrey Smirnov
2019-12-02 15:19 ` [PATCH 05/12] mci: imx-esdhc-pbl: Share initialization code Andrey Smirnov
2019-12-02 15:19 ` [PATCH 06/12] mci: imx-esdhc-pbl: Drop 'wrap_wml' flag Andrey Smirnov
2019-12-02 15:19 ` [PATCH 07/12] mci: imx-esdhc-pbl: Share IO accessors with regular driver Andrey Smirnov
2019-12-02 15:19 ` [PATCH 08/12] mci: imx-esdhc-pbl: Use sdhci_transfer_data() Andrey Smirnov
2019-12-02 15:19 ` [PATCH 09/12] mci: imx-esdhc-pbl: Use sdhci_set_cmd_xfer_mode() Andrey Smirnov
2019-12-02 15:19 ` [PATCH 10/12] mci: imx-esdhc: Share code for esdhc_(setup|do)_data operations Andrey Smirnov
2019-12-02 15:19 ` [PATCH 11/12] mci: imx-esdhc: Introduce esdhc_poll() Andrey Smirnov
2019-12-02 15:19 ` [PATCH 12/12] mci: imx-esdhc: Share code for esdhc_send_cmd() Andrey Smirnov
2019-12-04  8:42 ` [PATCH 00/12] Share i.MX ESDHC PBL and PIO code 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=20191202151954.16032-2-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.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