Skip to content

Commit 8c7a896

Browse files
hkallweitwsakernel
authored andcommitted
i2c: i801: Don't read back cleared status in i801_check_pre()
I see no need to read back the registers to verify that the bits have actually been cleared. I can't imagine any scenario where the bits would remain set after a write to them. Whilst at it, change involved syslog messages to use pci_dbg() et al. to simplify them. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Tested-by: Jean Delvare <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent c4bcef9 commit 8c7a896

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -328,22 +328,14 @@ static int i801_check_pre(struct i801_priv *priv)
328328

329329
status = inb_p(SMBHSTSTS(priv));
330330
if (status & SMBHSTSTS_HOST_BUSY) {
331-
dev_err(&priv->pci_dev->dev, "SMBus is busy, can't use it!\n");
331+
pci_err(priv->pci_dev, "SMBus is busy, can't use it!\n");
332332
return -EBUSY;
333333
}
334334

335335
status &= STATUS_FLAGS;
336336
if (status) {
337-
dev_dbg(&priv->pci_dev->dev, "Clearing status flags (%02x)\n",
338-
status);
337+
pci_dbg(priv->pci_dev, "Clearing status flags (%02x)\n", status);
339338
outb_p(status, SMBHSTSTS(priv));
340-
status = inb_p(SMBHSTSTS(priv)) & STATUS_FLAGS;
341-
if (status) {
342-
dev_err(&priv->pci_dev->dev,
343-
"Failed clearing status flags (%02x)\n",
344-
status);
345-
return -EBUSY;
346-
}
347339
}
348340

349341
/*
@@ -356,16 +348,8 @@ static int i801_check_pre(struct i801_priv *priv)
356348
if (priv->features & FEATURE_SMBUS_PEC) {
357349
status = inb_p(SMBAUXSTS(priv)) & SMBAUXSTS_CRCE;
358350
if (status) {
359-
dev_dbg(&priv->pci_dev->dev,
360-
"Clearing aux status flags (%02x)\n", status);
351+
pci_dbg(priv->pci_dev, "Clearing aux status flags (%02x)\n", status);
361352
outb_p(status, SMBAUXSTS(priv));
362-
status = inb_p(SMBAUXSTS(priv)) & SMBAUXSTS_CRCE;
363-
if (status) {
364-
dev_err(&priv->pci_dev->dev,
365-
"Failed clearing aux status flags (%02x)\n",
366-
status);
367-
return -EBUSY;
368-
}
369353
}
370354
}
371355

0 commit comments

Comments
 (0)