From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Beisert <jbe@pengutronix.de>
Subject: [PATCH 07/17] mci: mxs: Use dev_*
Date: Thu, 20 Jun 2013 08:54:11 +0200 [thread overview]
Message-ID: <1371711261-10039-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1371711261-10039-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mci/mxs.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index e6f40eb..cb2911a 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -116,22 +116,22 @@ static void mxs_mci_finish_request(struct mxs_mci_host *mxs_mci)
* @param status HW_SSP_STATUS's content
* @return 0 if no error, negative values else
*/
-static int mxs_mci_get_cmd_error(unsigned status)
+static int mxs_mci_get_cmd_error(struct mxs_mci_host *mxs_mci, unsigned status)
{
if (status & SSP_STATUS_ERROR)
- pr_debug("Status Reg reports %08X\n", status);
+ dev_dbg(mxs_mci->host.hw_dev, "Status Reg reports %08X\n", status);
if (status & SSP_STATUS_TIMEOUT) {
- pr_debug("CMD timeout\n");
+ dev_dbg(mxs_mci->host.hw_dev, "CMD timeout\n");
return -ETIMEDOUT;
} else if (status & SSP_STATUS_RESP_TIMEOUT) {
- pr_debug("RESP timeout\n");
+ dev_dbg(mxs_mci->host.hw_dev, "RESP timeout\n");
return -ETIMEDOUT;
} else if (status & SSP_STATUS_RESP_CRC_ERR) {
- pr_debug("CMD crc error\n");
+ dev_dbg(mxs_mci->host.hw_dev, "CMD crc error\n");
return -EILSEQ;
} else if (status & SSP_STATUS_RESP_ERR) {
- pr_debug("RESP error\n");
+ dev_dbg(mxs_mci->host.hw_dev, "RESP error\n");
return -EIO;
}
@@ -168,7 +168,8 @@ static int mxs_mci_read_data(struct mxs_mci_host *mxs_mci, void *buffer, unsigne
uint32_t *p = buffer;
if (length & 0x3) {
- pr_debug("Cannot read data sizes not multiple of 4 (request for %u detected)\n",
+ dev_dbg(mxs_mci->host.hw_dev,
+ "Cannot read data sizes not multiple of 4 (request for %u detected)\n",
length);
return -EINVAL;
}
@@ -206,7 +207,8 @@ static int mxs_mci_write_data(struct mxs_mci_host *mxs_mci, const void *buffer,
const uint32_t *p = buffer;
if (length & 0x3) {
- pr_debug("Cannot write data sizes not multiple of 4 (request for %u detected)\n",
+ dev_dbg(mxs_mci->host.hw_dev,
+ "Cannot write data sizes not multiple of 4 (request for %u detected)\n",
length);
return -EINVAL;
}
@@ -320,7 +322,7 @@ static int mxs_mci_std_cmds(struct mxs_mci_host *mxs_mci, struct mci_cmd *cmd)
if (cmd->resp_type & MMC_RSP_PRESENT)
mxs_mci_get_cards_response(mxs_mci, cmd);
- return mxs_mci_get_cmd_error(readl(mxs_mci->regs + HW_SSP_STATUS));
+ return mxs_mci_get_cmd_error(mxs_mci, readl(mxs_mci->regs + HW_SSP_STATUS));
}
/**
@@ -385,7 +387,7 @@ static int mxs_mci_adtc(struct mxs_mci_host *mxs_mci, struct mci_cmd *cmd,
err = mxs_mci_transfer_data(mxs_mci, data);
if (err != 0) {
- pr_debug(" Transfering data failed\n");
+ dev_dbg(mxs_mci->host.hw_dev, "Transfering data failed with %d\n", err);
return err;
}
@@ -436,7 +438,7 @@ static unsigned mxs_mci_setup_clock_speed(struct mxs_mci_host *mxs_mci, unsigned
break;
}
if (div >= 255) {
- pr_warning("Cannot set clock to %d Hz\n", nc);
+ dev_warn(mxs_mci->host.hw_dev, "Cannot set clock to %d Hz\n", nc);
return 0;
}
@@ -531,7 +533,8 @@ static void mxs_mci_set_ios(struct mci_host *host, struct mci_ios *ios)
}
mxs_mci->clock = mxs_mci_setup_clock_speed(mxs_mci, ios->clock);
- pr_debug("IO settings: frequency=%u Hz\n", mxs_mci->clock);
+
+ dev_dbg(host->hw_dev, "IO settings: frequency=%u Hz\n", mxs_mci->clock);
}
/* ----------------------------------------------------------------------- */
@@ -557,7 +560,7 @@ static int mxs_mci_probe(struct device_d *hw_dev)
struct mci_host *host;
if (hw_dev->platform_data == NULL) {
- pr_err("Missing platform data\n");
+ dev_err(hw_dev, "Missing platform data\n");
return -EINVAL;
}
@@ -600,18 +603,18 @@ static int mxs_mci_probe(struct device_d *hw_dev)
#endif
if (pd->f_min == 0) {
host->f_min = mxs_mci_get_unit_clock(mxs_mci) / 254 / 256;
- pr_debug("Min. frequency is %u Hz\n", host->f_min);
+ dev_dbg(hw_dev, "Min. frequency is %u Hz\n", host->f_min);
} else {
host->f_min = pd->f_min;
- pr_debug("Min. frequency is %u Hz, could be %u Hz\n",
+ dev_dbg(hw_dev, "Min. frequency is %u Hz, could be %u Hz\n",
host->f_min, mxs_mci_get_unit_clock(mxs_mci) / 254 / 256);
}
if (pd->f_max == 0) {
host->f_max = mxs_mci_get_unit_clock(mxs_mci) / 2 / 1;
- pr_debug("Max. frequency is %u Hz\n", host->f_max);
+ dev_dbg(hw_dev, "Max. frequency is %u Hz\n", host->f_max);
} else {
host->f_max = pd->f_max;
- pr_debug("Max. frequency is %u Hz, could be %u Hz\n",
+ dev_dbg(hw_dev, "Max. frequency is %u Hz, could be %u Hz\n",
host->f_max, mxs_mci_get_unit_clock(mxs_mci) / 2 / 1);
}
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-06-20 6:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 6:54 [PATCH] convert MXS to common clk Sascha Hauer
2013-06-20 6:54 ` [PATCH 01/17] clk: divider: Add onebased divider support Sascha Hauer
2013-06-20 6:54 ` [PATCH 02/17] clk: gate: Add inverted gate support Sascha Hauer
2013-06-20 6:54 ` [PATCH 03/17] clk: add prototype for clk_is_enabled Sascha Hauer
2013-06-20 6:54 ` [PATCH 04/17] ARM: MXS: Add MXS specific clk types Sascha Hauer
2013-06-21 12:14 ` Jürgen Beisert
2013-06-20 6:54 ` [PATCH 05/17] ARM: MXS: add clk drivers Sascha Hauer
2013-06-20 6:54 ` [PATCH 06/17] ARM: MXS: remove board specific clock setups Sascha Hauer
2013-06-20 6:54 ` Sascha Hauer [this message]
2013-06-20 6:54 ` [PATCH 08/17] net: fec: Use clk API unconditionally Sascha Hauer
2013-06-20 6:54 ` [PATCH 09/17] mci: mxs: use common clk API Sascha Hauer
2013-06-20 6:54 ` [PATCH 10/17] mtd: gpmi-nand: switch to clk support Sascha Hauer
2013-06-20 6:54 ` [PATCH 11/17] serial: auart: Use " Sascha Hauer
2013-06-20 6:54 ` [PATCH 12/17] serial: stm: " Sascha Hauer
2013-06-20 6:54 ` [PATCH 13/17] spi: mxs: " Sascha Hauer
2013-06-20 6:54 ` [PATCH 14/17] ARM: MXS: octotp: switch to " Sascha Hauer
2013-06-20 6:54 ` [PATCH 15/17] ARM: MXS: remove imx_enable_enetclk Sascha Hauer
2013-06-20 6:54 ` [PATCH 16/17] video: stm: switch to clk support Sascha Hauer
2013-06-20 6:54 ` [PATCH 17/17] ARM: MXS: remove old clock support 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=1371711261-10039-8-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jbe@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