Skip to content

Commit 33a00d9

Browse files
Alain Volmatwsakernel
authored andcommitted
i2c: stm32f7: simplify status messages in case of errors
Avoid usage of __func__ when reporting an error message since dev_err/dev_dbg are already providing enough details to identify the source of the message. Signed-off-by: Alain Volmat <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent e6103cd commit 33a00d9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/i2c/busses/i2c-stm32f7.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,7 @@ static irqreturn_t stm32f7_i2c_isr_error_thread(int irq, void *data)
16021602
{
16031603
struct stm32f7_i2c_dev *i2c_dev = data;
16041604
struct stm32f7_i2c_msg *f7_msg = &i2c_dev->f7_msg;
1605+
u16 addr = f7_msg->addr;
16051606
void __iomem *base = i2c_dev->base;
16061607
struct device *dev = i2c_dev->dev;
16071608
struct stm32_i2c_dma *dma = i2c_dev->dma;
@@ -1611,30 +1612,27 @@ static irqreturn_t stm32f7_i2c_isr_error_thread(int irq, void *data)
16111612

16121613
/* Bus error */
16131614
if (status & STM32F7_I2C_ISR_BERR) {
1614-
dev_err(dev, "<%s>: Bus error accessing addr 0x%x\n",
1615-
__func__, f7_msg->addr);
1615+
dev_err(dev, "Bus error accessing addr 0x%x\n", addr);
16161616
writel_relaxed(STM32F7_I2C_ICR_BERRCF, base + STM32F7_I2C_ICR);
16171617
stm32f7_i2c_release_bus(&i2c_dev->adap);
16181618
f7_msg->result = -EIO;
16191619
}
16201620

16211621
/* Arbitration loss */
16221622
if (status & STM32F7_I2C_ISR_ARLO) {
1623-
dev_dbg(dev, "<%s>: Arbitration loss accessing addr 0x%x\n",
1624-
__func__, f7_msg->addr);
1623+
dev_dbg(dev, "Arbitration loss accessing addr 0x%x\n", addr);
16251624
writel_relaxed(STM32F7_I2C_ICR_ARLOCF, base + STM32F7_I2C_ICR);
16261625
f7_msg->result = -EAGAIN;
16271626
}
16281627

16291628
if (status & STM32F7_I2C_ISR_PECERR) {
1630-
dev_err(dev, "<%s>: PEC error in reception accessing addr 0x%x\n",
1631-
__func__, f7_msg->addr);
1629+
dev_err(dev, "PEC error in reception accessing addr 0x%x\n", addr);
16321630
writel_relaxed(STM32F7_I2C_ICR_PECCF, base + STM32F7_I2C_ICR);
16331631
f7_msg->result = -EINVAL;
16341632
}
16351633

16361634
if (status & STM32F7_I2C_ISR_ALERT) {
1637-
dev_dbg(dev, "<%s>: SMBus alert received\n", __func__);
1635+
dev_dbg(dev, "SMBus alert received\n");
16381636
writel_relaxed(STM32F7_I2C_ICR_ALERTCF, base + STM32F7_I2C_ICR);
16391637
i2c_handle_smbus_alert(i2c_dev->alert->ara);
16401638
return IRQ_HANDLED;

0 commit comments

Comments
 (0)