Commit 3697aaaf authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Damien Le Moal

ata: pata_it821x: convert printk() calls

Convert printk() calls to structured logging.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 3dede7f9
...@@ -431,7 +431,8 @@ static unsigned int it821x_smart_qc_issue(struct ata_queued_cmd *qc) ...@@ -431,7 +431,8 @@ static unsigned int it821x_smart_qc_issue(struct ata_queued_cmd *qc)
case ATA_CMD_SET_FEATURES: case ATA_CMD_SET_FEATURES:
return ata_bmdma_qc_issue(qc); return ata_bmdma_qc_issue(qc);
} }
printk(KERN_DEBUG "it821x: can't process command 0x%02X\n", qc->tf.command); ata_dev_dbg(qc->dev, "it821x: can't process command 0x%02X\n",
qc->tf.command);
return AC_ERR_DEV; return AC_ERR_DEV;
} }
...@@ -507,12 +508,14 @@ static void it821x_dev_config(struct ata_device *adev) ...@@ -507,12 +508,14 @@ static void it821x_dev_config(struct ata_device *adev)
if (strstr(model_num, "Integrated Technology Express")) { if (strstr(model_num, "Integrated Technology Express")) {
/* RAID mode */ /* RAID mode */
ata_dev_info(adev, "%sRAID%d volume", if (adev->id[129] == 1)
adev->id[147] ? "Bootable " : "", ata_dev_info(adev, "%sRAID%d volume\n",
adev->id[129]); adev->id[147] ? "Bootable " : "",
if (adev->id[129] != 1) adev->id[129]);
pr_cont("(%dK stripe)", adev->id[146]); else
pr_cont("\n"); ata_dev_info(adev, "%sRAID%d volume (%dK stripe)\n",
adev->id[147] ? "Bootable " : "",
adev->id[129], adev->id[146]);
} }
/* This is a controller firmware triggered funny, don't /* This is a controller firmware triggered funny, don't
report the drive faulty! */ report the drive faulty! */
...@@ -593,6 +596,7 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc) ...@@ -593,6 +596,7 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc)
/** /**
* it821x_display_disk - display disk setup * it821x_display_disk - display disk setup
* @ap: ATA port
* @n: Device number * @n: Device number
* @buf: Buffer block from firmware * @buf: Buffer block from firmware
* *
...@@ -600,7 +604,7 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc) ...@@ -600,7 +604,7 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc)
* by the firmware. * by the firmware.
*/ */
static void it821x_display_disk(int n, u8 *buf) static void it821x_display_disk(struct ata_port *ap, int n, u8 *buf)
{ {
unsigned char id[41]; unsigned char id[41];
int mode = 0; int mode = 0;
...@@ -633,13 +637,13 @@ static void it821x_display_disk(int n, u8 *buf) ...@@ -633,13 +637,13 @@ static void it821x_display_disk(int n, u8 *buf)
else else
strcpy(mbuf, "PIO"); strcpy(mbuf, "PIO");
if (buf[52] == 4) if (buf[52] == 4)
printk(KERN_INFO "%d: %-6s %-8s %s %s\n", ata_port_info(ap, "%d: %-6s %-8s %s %s\n",
n, mbuf, types[buf[52]], id, cbl); n, mbuf, types[buf[52]], id, cbl);
else else
printk(KERN_INFO "%d: %-6s %-8s Volume: %1d %s %s\n", ata_port_info(ap, "%d: %-6s %-8s Volume: %1d %s %s\n",
n, mbuf, types[buf[52]], buf[53], id, cbl); n, mbuf, types[buf[52]], buf[53], id, cbl);
if (buf[125] < 100) if (buf[125] < 100)
printk(KERN_INFO "%d: Rebuilding: %d%%\n", n, buf[125]); ata_port_info(ap, "%d: Rebuilding: %d%%\n", n, buf[125]);
} }
/** /**
...@@ -676,7 +680,7 @@ static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len) ...@@ -676,7 +680,7 @@ static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len)
status = ioread8(ap->ioaddr.status_addr); status = ioread8(ap->ioaddr.status_addr);
if (status & ATA_ERR) { if (status & ATA_ERR) {
kfree(buf); kfree(buf);
printk(KERN_ERR "it821x_firmware_command: rejected\n"); ata_port_err(ap, "%s: rejected\n", __func__);
return NULL; return NULL;
} }
if (status & ATA_DRQ) { if (status & ATA_DRQ) {
...@@ -686,7 +690,7 @@ static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len) ...@@ -686,7 +690,7 @@ static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len)
usleep_range(500, 1000); usleep_range(500, 1000);
} }
kfree(buf); kfree(buf);
printk(KERN_ERR "it821x_firmware_command: timeout\n"); ata_port_err(ap, "%s: timeout\n", __func__);
return NULL; return NULL;
} }
...@@ -709,13 +713,13 @@ static void it821x_probe_firmware(struct ata_port *ap) ...@@ -709,13 +713,13 @@ static void it821x_probe_firmware(struct ata_port *ap)
buf = it821x_firmware_command(ap, 0xFA, 512); buf = it821x_firmware_command(ap, 0xFA, 512);
if (buf != NULL) { if (buf != NULL) {
printk(KERN_INFO "pata_it821x: Firmware %02X/%02X/%02X%02X\n", ata_port_info(ap, "pata_it821x: Firmware %02X/%02X/%02X%02X\n",
buf[505], buf[505],
buf[506], buf[506],
buf[507], buf[507],
buf[508]); buf[508]);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
it821x_display_disk(i, buf + 128 * i); it821x_display_disk(ap, i, buf + 128 * i);
kfree(buf); kfree(buf);
} }
} }
...@@ -771,7 +775,8 @@ static int it821x_port_start(struct ata_port *ap) ...@@ -771,7 +775,8 @@ static int it821x_port_start(struct ata_port *ap)
itdev->timing10 = 1; itdev->timing10 = 1;
/* Need to disable ATAPI DMA for this case */ /* Need to disable ATAPI DMA for this case */
if (!itdev->smart) if (!itdev->smart)
printk(KERN_WARNING DRV_NAME": Revision 0x10, workarounds activated.\n"); dev_warn(&pdev->dev,
"Revision 0x10, workarounds activated.\n");
} }
return 0; return 0;
...@@ -919,14 +924,14 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -919,14 +924,14 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
} else { } else {
/* Force the card into bypass mode if so requested */ /* Force the card into bypass mode if so requested */
if (it8212_noraid) { if (it8212_noraid) {
printk(KERN_INFO DRV_NAME ": forcing bypass mode.\n"); dev_info(&pdev->dev, "forcing bypass mode.\n");
it821x_disable_raid(pdev); it821x_disable_raid(pdev);
} }
pci_read_config_byte(pdev, 0x50, &conf); pci_read_config_byte(pdev, 0x50, &conf);
conf &= 1; conf &= 1;
printk(KERN_INFO DRV_NAME": controller in %s mode.\n", dev_info(&pdev->dev, "controller in %s mode.\n", mode[conf]);
mode[conf]);
if (conf == 0) if (conf == 0)
ppi[0] = &info_passthru; ppi[0] = &info_passthru;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment