> -Original Message-
> From: Bjorn Helgaas [mailto:bhelg...@google.com]
> Sent: Wednesday, July 08, 2015 2:23 AM
> To: Kashyap Desai; Uday Lingala; Sumit Saxena
> Cc: megaraidlinux@avagotech.com; linux-s...@vger.kernel.org; James
> E.J.
> Bottomley; linux-kernel@vger.kernel.org; Joe Perches; Christoph Hellwig
> Subject: [PATCH v3 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 | 304
> +--
> drivers/scsi/megaraid/megaraid_sas_fusion.c | 95
> 2 files changed, 196 insertions(+), 203 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 71b884d..a9bd592 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -216,7 +216,7 @@ struct megasas_cmd *megasas_get_cmd(struct
> megasas_instance
>struct megasas_cmd, list);
> list_del_init(&cmd->list);
> } 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);
> @@ -370,9 +370,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);
> @@ -383,9 +383,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);
> @@ -824,7 +824,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)
> @@ -832,7 +832,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);
>
> @@ -842,7 +842,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)
> @@ -1241,7 +1241,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 too many SGE
> NUM=%x\n",
> pthru->sge_count);
> return 0;
> }
> @@ -1382,7 +1382,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,