>-Original Message-
>From: Bjorn Helgaas [mailto:bhelg...@google.com]
>Sent: Wednesday, April 29, 2015 4:44 AM
>To: Kashyap Desai; Uday Lingala; Sumit Saxena
>Cc: megaraidlinux@avagotech.com; James E.J. Bottomley; linux-
>ker...@vger.kernel.org; linux-s...@vger.kernel.org
>Subject: [PATCH 2/3] megaraid_sas: use dev_printk when possible
>
>Use dev_printk() when possible to make messages more useful.
>
>Signed-off-by: Bjorn Helgaas
>---
> drivers/scsi/megaraid/megaraid_sas_base.c | 281 ++--
>-
> 1 file changed, 139 insertions(+), 142 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index 890637f..9ef6631 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -217,7 +217,7 @@ struct megasas_cmd *megasas_get_cmd(struct
>megasas_instance
> list_del_init(&cmd->list);
> atomic_set(&cmd->mfi_mpt_pthr, MFI_MPT_DETACHED);
> } else {
>- printk(KERN_ERR "megasas: Command pool empty!\n");
>+ dev_err(&instance->pdev->dev, "Command pool empty!\n");
> }
>
> spin_unlock_irqrestore(&instance->mfi_pool_lock, flags); @@ -382,9
>+382,9 @@ megasas_adp_reset_xscale(struct megasas_instance *instance,
> msleep(1000); /* sleep for 3 secs */
> pcidata = 0;
> pci_read_config_dword(instance->pdev, MFI_1068_PCSR_OFFSET,
>&pcidata);
>- printk(KERN_NOTICE "pcidata = %x\n", pcidata);
>+ dev_notice(&instance->pdev->dev, "pcidata = %x\n", pcidata);
> if (pcidata & 0x2) {
>- printk(KERN_NOTICE "mfi 1068 offset read=%x\n", pcidata);
>+ dev_notice(&instance->pdev->dev, "mfi 1068 offset
>read=%x\n",
>+pcidata);
> pcidata &= ~0x2;
> pci_write_config_dword(instance->pdev,
> MFI_1068_PCSR_OFFSET, pcidata);
>@@ -395,9 +395,9 @@ megasas_adp_reset_xscale(struct megasas_instance
>*instance,
> pcidata = 0;
> pci_read_config_dword(instance->pdev,
> MFI_1068_FW_HANDSHAKE_OFFSET,
>&pcidata);
>- printk(KERN_NOTICE "1068 offset handshake read=%x\n",
>pcidata);
>+ dev_notice(&instance->pdev->dev, "1068 offset handshake
>read=%x\n",
>+pcidata);
> if ((pcidata & 0x) == MFI_1068_FW_READY) {
>- printk(KERN_NOTICE "1068 offset pcidt=%x\n",
>pcidata);
>+ dev_notice(&instance->pdev->dev, "1068 offset
>pcidt=%x\n", pcidata);
> pcidata = 0;
> pci_write_config_dword(instance->pdev,
> MFI_1068_FW_HANDSHAKE_OFFSET,
>pcidata); @@ -836,7 +836,7 @@ megasas_adp_reset_gen2(struct
>megasas_instance *instance,
> while ( !( HostDiag & DIAG_WRITE_ENABLE) ) {
> msleep(100);
> HostDiag = (u32)readl(hostdiag_offset);
>- printk(KERN_NOTICE "RESETGEN2: retry=%x, hostdiag=%x\n",
>+ dev_notice(&instance->pdev->dev, "RESETGEN2: retry=%x,
>+hostdiag=%x\n",
> retry, HostDiag);
>
> if (retry++ >= 100)
>@@ -844,7 +844,7 @@ megasas_adp_reset_gen2(struct megasas_instance
>*instance,
>
> }
>
>- printk(KERN_NOTICE "ADP_RESET_GEN2: HostDiag=%x\n", HostDiag);
>+ dev_notice(&instance->pdev->dev, "ADP_RESET_GEN2:
>HostDiag=%x\n",
>+HostDiag);
>
> writel((HostDiag | DIAG_RESET_ADAPTER), hostdiag_offset);
>
>@@ -854,7 +854,7 @@ megasas_adp_reset_gen2(struct megasas_instance
>*instance,
> while ( ( HostDiag & DIAG_RESET_ADAPTER) ) {
> msleep(100);
> HostDiag = (u32)readl(hostdiag_offset);
>- printk(KERN_NOTICE "RESET_GEN2: retry=%x,
>hostdiag=%x\n",
>+ dev_notice(&instance->pdev->dev, "RESET_GEN2: retry=%x,
>+hostdiag=%x\n",
> retry, HostDiag);
>
> if (retry++ >= 1000)
>@@ -1253,7 +1253,7 @@ megasas_build_dcdb(struct megasas_instance
>*instance, struct scsi_cmnd *scp,
> &pthru->sgl);
>
> if (pthru->sge_count > instance->max_num_sge) {
>- printk(KERN_ERR "megasas: DCDB two many SGE
>NUM=%x\n",
>+ dev_err(&instance->pdev->dev, "DCDB two many SGE
>NUM=%x\n",
> pthru->sge_count);
> return 0;
> }
>@@ -1394,7 +1394,7 @@ megasas_build_ldio(struct megasas_instance
>*instance, struct scsi_cmnd *scp,
> ldio->sge_count = megasas_make_sgl32(instance, scp, &ldio-
>>sgl);
>
> if (ldio->sge_count > instance->max_num_sge) {
>- printk(KERN_ERR "megasas: build_ld_io: sge_count = %x\n",
>+ dev_err(&instance->pdev->dev, "build_ld_io: sge_count =
>%x\n",
> ldio->sge_count);
> return 0;
> }
>@@ -1461,24 +1461