i2c: uniphier(-f): remove all dev_dbg()

I have fixed various bugs, and these drivers are (I hope) pretty
stable now. Remove all dev_dbg() for code clean-up.

If I end up with debugging the drivers again, I will locally revert
this commit. I no longer need the debug code in upstream.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Masahiro Yamada 2019-09-05 13:46:48 +09:00 committed by Wolfram Sang
parent 22ac74a619
commit 9ee7e72fbb
2 changed files with 4 additions and 36 deletions

View File

@ -108,7 +108,6 @@ static void uniphier_fi2c_fill_txfifo(struct uniphier_fi2c_priv *priv,
if (fifo_space-- <= 0) if (fifo_space-- <= 0)
break; break;
dev_dbg(&priv->adap.dev, "write data: %02x\n", *priv->buf);
writel(*priv->buf++, priv->membase + UNIPHIER_FI2C_DTTX); writel(*priv->buf++, priv->membase + UNIPHIER_FI2C_DTTX);
priv->len--; priv->len--;
} }
@ -124,7 +123,6 @@ static void uniphier_fi2c_drain_rxfifo(struct uniphier_fi2c_priv *priv)
break; break;
*priv->buf++ = readl(priv->membase + UNIPHIER_FI2C_DTRX); *priv->buf++ = readl(priv->membase + UNIPHIER_FI2C_DTRX);
dev_dbg(&priv->adap.dev, "read data: %02x\n", priv->buf[-1]);
priv->len--; priv->len--;
} }
} }
@ -142,8 +140,6 @@ static void uniphier_fi2c_clear_irqs(struct uniphier_fi2c_priv *priv,
static void uniphier_fi2c_stop(struct uniphier_fi2c_priv *priv) static void uniphier_fi2c_stop(struct uniphier_fi2c_priv *priv)
{ {
dev_dbg(&priv->adap.dev, "stop condition\n");
priv->enabled_irqs |= UNIPHIER_FI2C_INT_STOP; priv->enabled_irqs |= UNIPHIER_FI2C_INT_STOP;
uniphier_fi2c_set_irqs(priv); uniphier_fi2c_set_irqs(priv);
writel(UNIPHIER_FI2C_CR_MST | UNIPHIER_FI2C_CR_STO, writel(UNIPHIER_FI2C_CR_MST | UNIPHIER_FI2C_CR_STO,
@ -160,21 +156,15 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id)
irq_status = readl(priv->membase + UNIPHIER_FI2C_INT); irq_status = readl(priv->membase + UNIPHIER_FI2C_INT);
irq_status &= priv->enabled_irqs; irq_status &= priv->enabled_irqs;
dev_dbg(&priv->adap.dev,
"interrupt: enabled_irqs=%04x, irq_status=%04x\n",
priv->enabled_irqs, irq_status);
if (irq_status & UNIPHIER_FI2C_INT_STOP) if (irq_status & UNIPHIER_FI2C_INT_STOP)
goto complete; goto complete;
if (unlikely(irq_status & UNIPHIER_FI2C_INT_AL)) { if (unlikely(irq_status & UNIPHIER_FI2C_INT_AL)) {
dev_dbg(&priv->adap.dev, "arbitration lost\n");
priv->error = -EAGAIN; priv->error = -EAGAIN;
goto complete; goto complete;
} }
if (unlikely(irq_status & UNIPHIER_FI2C_INT_NA)) { if (unlikely(irq_status & UNIPHIER_FI2C_INT_NA)) {
dev_dbg(&priv->adap.dev, "could not get ACK\n");
priv->error = -ENXIO; priv->error = -ENXIO;
if (priv->flags & UNIPHIER_FI2C_RD) { if (priv->flags & UNIPHIER_FI2C_RD) {
/* /*
@ -215,18 +205,14 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id)
if (unlikely(priv->flags & UNIPHIER_FI2C_MANUAL_NACK)) { if (unlikely(priv->flags & UNIPHIER_FI2C_MANUAL_NACK)) {
if (priv->len <= UNIPHIER_FI2C_FIFO_SIZE && if (priv->len <= UNIPHIER_FI2C_FIFO_SIZE &&
!(priv->flags & UNIPHIER_FI2C_BYTE_WISE)) { !(priv->flags & UNIPHIER_FI2C_BYTE_WISE)) {
dev_dbg(&priv->adap.dev,
"enable read byte count IRQ\n");
priv->enabled_irqs |= UNIPHIER_FI2C_INT_RB; priv->enabled_irqs |= UNIPHIER_FI2C_INT_RB;
uniphier_fi2c_set_irqs(priv); uniphier_fi2c_set_irqs(priv);
priv->flags |= UNIPHIER_FI2C_BYTE_WISE; priv->flags |= UNIPHIER_FI2C_BYTE_WISE;
} }
if (priv->len <= 1) { if (priv->len <= 1)
dev_dbg(&priv->adap.dev, "set NACK\n");
writel(UNIPHIER_FI2C_CR_MST | writel(UNIPHIER_FI2C_CR_MST |
UNIPHIER_FI2C_CR_NACK, UNIPHIER_FI2C_CR_NACK,
priv->membase + UNIPHIER_FI2C_CR); priv->membase + UNIPHIER_FI2C_CR);
}
} }
goto handled; goto handled;
@ -334,10 +320,6 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
bool is_read = msg->flags & I2C_M_RD; bool is_read = msg->flags & I2C_M_RD;
unsigned long time_left, flags; unsigned long time_left, flags;
dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, repeat=%d, stop=%d\n",
is_read ? "receive" : "transmit", msg->addr, msg->len,
repeat, stop);
priv->len = msg->len; priv->len = msg->len;
priv->buf = msg->buf; priv->buf = msg->buf;
priv->enabled_irqs = UNIPHIER_FI2C_INT_FAULTS; priv->enabled_irqs = UNIPHIER_FI2C_INT_FAULTS;
@ -359,7 +341,6 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
else else
uniphier_fi2c_tx_init(priv, msg->addr, repeat); uniphier_fi2c_tx_init(priv, msg->addr, repeat);
dev_dbg(&adap->dev, "start condition\n");
/* /*
* For a repeated START condition, writing a slave address to the FIFO * For a repeated START condition, writing a slave address to the FIFO
* kicks the controller. So, the UNIPHIER_FI2C_CR register should be * kicks the controller. So, the UNIPHIER_FI2C_CR register should be
@ -383,7 +364,6 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
uniphier_fi2c_recover(priv); uniphier_fi2c_recover(priv);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
dev_dbg(&adap->dev, "complete\n");
if (unlikely(priv->flags & UNIPHIER_FI2C_DEFER_STOP_COMP)) { if (unlikely(priv->flags & UNIPHIER_FI2C_DEFER_STOP_COMP)) {
u32 status; u32 status;

View File

@ -71,7 +71,6 @@ static int uniphier_i2c_xfer_byte(struct i2c_adapter *adap, u32 txdata,
reinit_completion(&priv->comp); reinit_completion(&priv->comp);
txdata |= UNIPHIER_I2C_DTRM_IRQEN; txdata |= UNIPHIER_I2C_DTRM_IRQEN;
dev_dbg(&adap->dev, "write data: 0x%04x\n", txdata);
writel(txdata, priv->membase + UNIPHIER_I2C_DTRM); writel(txdata, priv->membase + UNIPHIER_I2C_DTRM);
time_left = wait_for_completion_timeout(&priv->comp, adap->timeout); time_left = wait_for_completion_timeout(&priv->comp, adap->timeout);
@ -81,8 +80,6 @@ static int uniphier_i2c_xfer_byte(struct i2c_adapter *adap, u32 txdata,
} }
rxdata = readl(priv->membase + UNIPHIER_I2C_DREC); rxdata = readl(priv->membase + UNIPHIER_I2C_DREC);
dev_dbg(&adap->dev, "read data: 0x%04x\n", rxdata);
if (rxdatap) if (rxdatap)
*rxdatap = rxdata; *rxdatap = rxdata;
@ -98,14 +95,11 @@ static int uniphier_i2c_send_byte(struct i2c_adapter *adap, u32 txdata)
if (ret) if (ret)
return ret; return ret;
if (unlikely(rxdata & UNIPHIER_I2C_DREC_LAB)) { if (unlikely(rxdata & UNIPHIER_I2C_DREC_LAB))
dev_dbg(&adap->dev, "arbitration lost\n");
return -EAGAIN; return -EAGAIN;
}
if (unlikely(rxdata & UNIPHIER_I2C_DREC_LRB)) { if (unlikely(rxdata & UNIPHIER_I2C_DREC_LRB))
dev_dbg(&adap->dev, "could not get ACK\n");
return -ENXIO; return -ENXIO;
}
return 0; return 0;
} }
@ -115,7 +109,6 @@ static int uniphier_i2c_tx(struct i2c_adapter *adap, u16 addr, u16 len,
{ {
int ret; int ret;
dev_dbg(&adap->dev, "start condition\n");
ret = uniphier_i2c_send_byte(adap, addr << 1 | ret = uniphier_i2c_send_byte(adap, addr << 1 |
UNIPHIER_I2C_DTRM_STA | UNIPHIER_I2C_DTRM_STA |
UNIPHIER_I2C_DTRM_NACK); UNIPHIER_I2C_DTRM_NACK);
@ -137,7 +130,6 @@ static int uniphier_i2c_rx(struct i2c_adapter *adap, u16 addr, u16 len,
{ {
int ret; int ret;
dev_dbg(&adap->dev, "start condition\n");
ret = uniphier_i2c_send_byte(adap, addr << 1 | ret = uniphier_i2c_send_byte(adap, addr << 1 |
UNIPHIER_I2C_DTRM_STA | UNIPHIER_I2C_DTRM_STA |
UNIPHIER_I2C_DTRM_NACK | UNIPHIER_I2C_DTRM_NACK |
@ -161,7 +153,6 @@ static int uniphier_i2c_rx(struct i2c_adapter *adap, u16 addr, u16 len,
static int uniphier_i2c_stop(struct i2c_adapter *adap) static int uniphier_i2c_stop(struct i2c_adapter *adap)
{ {
dev_dbg(&adap->dev, "stop condition\n");
return uniphier_i2c_send_byte(adap, UNIPHIER_I2C_DTRM_STO | return uniphier_i2c_send_byte(adap, UNIPHIER_I2C_DTRM_STO |
UNIPHIER_I2C_DTRM_NACK); UNIPHIER_I2C_DTRM_NACK);
} }
@ -173,9 +164,6 @@ static int uniphier_i2c_master_xfer_one(struct i2c_adapter *adap,
bool recovery = false; bool recovery = false;
int ret; int ret;
dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, stop=%d\n",
is_read ? "receive" : "transmit", msg->addr, msg->len, stop);
if (is_read) if (is_read)
ret = uniphier_i2c_rx(adap, msg->addr, msg->len, msg->buf); ret = uniphier_i2c_rx(adap, msg->addr, msg->len, msg->buf);
else else