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

ata: sata_mv: convert remaining printk() to structured logging

Refactor the .reset_hc() callback and convert the remaining 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 16d6623f
...@@ -579,7 +579,7 @@ struct mv_hw_ops { ...@@ -579,7 +579,7 @@ struct mv_hw_ops {
void (*enable_leds)(struct mv_host_priv *hpriv, void __iomem *mmio); void (*enable_leds)(struct mv_host_priv *hpriv, void __iomem *mmio);
void (*read_preamp)(struct mv_host_priv *hpriv, int idx, void (*read_preamp)(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio); void __iomem *mmio);
int (*reset_hc)(struct mv_host_priv *hpriv, void __iomem *mmio, int (*reset_hc)(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc); unsigned int n_hc);
void (*reset_flash)(struct mv_host_priv *hpriv, void __iomem *mmio); void (*reset_flash)(struct mv_host_priv *hpriv, void __iomem *mmio);
void (*reset_bus)(struct ata_host *host, void __iomem *mmio); void (*reset_bus)(struct ata_host *host, void __iomem *mmio);
...@@ -606,7 +606,7 @@ static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -606,7 +606,7 @@ static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio); static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio);
static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx, static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio); void __iomem *mmio);
static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, static int mv5_reset_hc(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc); unsigned int n_hc);
static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio); static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio);
static void mv5_reset_bus(struct ata_host *host, void __iomem *mmio); static void mv5_reset_bus(struct ata_host *host, void __iomem *mmio);
...@@ -616,14 +616,14 @@ static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -616,14 +616,14 @@ static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio); static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio);
static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx, static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio); void __iomem *mmio);
static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, static int mv6_reset_hc(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc); unsigned int n_hc);
static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio); static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio);
static void mv_soc_enable_leds(struct mv_host_priv *hpriv, static void mv_soc_enable_leds(struct mv_host_priv *hpriv,
void __iomem *mmio); void __iomem *mmio);
static void mv_soc_read_preamp(struct mv_host_priv *hpriv, int idx, static void mv_soc_read_preamp(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio); void __iomem *mmio);
static int mv_soc_reset_hc(struct mv_host_priv *hpriv, static int mv_soc_reset_hc(struct ata_host *host,
void __iomem *mmio, unsigned int n_hc); void __iomem *mmio, unsigned int n_hc);
static void mv_soc_reset_flash(struct mv_host_priv *hpriv, static void mv_soc_reset_flash(struct mv_host_priv *hpriv,
void __iomem *mmio); void __iomem *mmio);
...@@ -3194,9 +3194,10 @@ static void mv5_reset_one_hc(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -3194,9 +3194,10 @@ static void mv5_reset_one_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
} }
#undef ZERO #undef ZERO
static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, static int mv5_reset_hc(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc) unsigned int n_hc)
{ {
struct mv_host_priv *hpriv = host->private_data;
unsigned int hc, port; unsigned int hc, port;
for (hc = 0; hc < n_hc; hc++) { for (hc = 0; hc < n_hc; hc++) {
...@@ -3255,7 +3256,7 @@ static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio) ...@@ -3255,7 +3256,7 @@ static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio)
* LOCKING: * LOCKING:
* Inherited from caller. * Inherited from caller.
*/ */
static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, static int mv6_reset_hc(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc) unsigned int n_hc)
{ {
void __iomem *reg = mmio + PCI_MAIN_CMD_STS; void __iomem *reg = mmio + PCI_MAIN_CMD_STS;
...@@ -3275,7 +3276,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -3275,7 +3276,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
break; break;
} }
if (!(PCI_MASTER_EMPTY & t)) { if (!(PCI_MASTER_EMPTY & t)) {
printk(KERN_ERR DRV_NAME ": PCI master won't flush\n"); dev_err(host->dev, "PCI master won't flush\n");
rc = 1; rc = 1;
goto done; goto done;
} }
...@@ -3289,7 +3290,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -3289,7 +3290,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
} while (!(GLOB_SFT_RST & t) && (i-- > 0)); } while (!(GLOB_SFT_RST & t) && (i-- > 0));
if (!(GLOB_SFT_RST & t)) { if (!(GLOB_SFT_RST & t)) {
printk(KERN_ERR DRV_NAME ": can't set global reset\n"); dev_err(host->dev, "can't set global reset\n");
rc = 1; rc = 1;
goto done; goto done;
} }
...@@ -3303,7 +3304,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, ...@@ -3303,7 +3304,7 @@ static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
} while ((GLOB_SFT_RST & t) && (i-- > 0)); } while ((GLOB_SFT_RST & t) && (i-- > 0));
if (GLOB_SFT_RST & t) { if (GLOB_SFT_RST & t) {
printk(KERN_ERR DRV_NAME ": can't clear global reset\n"); dev_err(host->dev, "can't clear global reset\n");
rc = 1; rc = 1;
} }
done: done:
...@@ -3472,9 +3473,10 @@ static void mv_soc_reset_one_hc(struct mv_host_priv *hpriv, ...@@ -3472,9 +3473,10 @@ static void mv_soc_reset_one_hc(struct mv_host_priv *hpriv,
#undef ZERO #undef ZERO
static int mv_soc_reset_hc(struct mv_host_priv *hpriv, static int mv_soc_reset_hc(struct ata_host *host,
void __iomem *mmio, unsigned int n_hc) void __iomem *mmio, unsigned int n_hc)
{ {
struct mv_host_priv *hpriv = host->private_data;
unsigned int port; unsigned int port;
for (port = 0; port < hpriv->n_ports; port++) for (port = 0; port < hpriv->n_ports; port++)
...@@ -3847,11 +3849,11 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) ...@@ -3847,11 +3849,11 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
* *
* Warn the user, lest they think we're just buggy. * Warn the user, lest they think we're just buggy.
*/ */
printk(KERN_WARNING DRV_NAME ": Highpoint RocketRAID" dev_warn(&pdev->dev, "Highpoint RocketRAID"
" BIOS CORRUPTS DATA on all attached drives," " BIOS CORRUPTS DATA on all attached drives,"
" regardless of if/how they are configured." " regardless of if/how they are configured."
" BEWARE!\n"); " BEWARE!\n");
printk(KERN_WARNING DRV_NAME ": For data safety, do not" dev_warn(&pdev->dev, "For data safety, do not"
" use sectors 8-9 on \"Legacy\" drives," " use sectors 8-9 on \"Legacy\" drives,"
" and avoid the final two gigabytes on" " and avoid the final two gigabytes on"
" all RocketRAID BIOS initialized drives.\n"); " all RocketRAID BIOS initialized drives.\n");
...@@ -3942,7 +3944,7 @@ static int mv_init_host(struct ata_host *host) ...@@ -3942,7 +3944,7 @@ static int mv_init_host(struct ata_host *host)
if (hpriv->ops->read_preamp) if (hpriv->ops->read_preamp)
hpriv->ops->read_preamp(hpriv, port, mmio); hpriv->ops->read_preamp(hpriv, port, mmio);
rc = hpriv->ops->reset_hc(hpriv, mmio, n_hc); rc = hpriv->ops->reset_hc(host, mmio, n_hc);
if (rc) if (rc)
goto done; goto done;
...@@ -4258,7 +4260,7 @@ static int mv_platform_resume(struct platform_device *pdev) ...@@ -4258,7 +4260,7 @@ static int mv_platform_resume(struct platform_device *pdev)
/* initialize adapter */ /* initialize adapter */
ret = mv_init_host(host); ret = mv_init_host(host);
if (ret) { if (ret) {
printk(KERN_ERR DRV_NAME ": Error during HW init\n"); dev_err(&pdev->dev, "Error during HW init\n");
return ret; return ret;
} }
ata_host_resume(host); ata_host_resume(host);
......
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