@@ -344,25 +344,19 @@ void fnic_log_q_error(struct fnic *fnic)
344344 for (i = 0 ; i < fnic -> raw_wq_count ; i ++ ) {
345345 error_status = ioread32 (& fnic -> wq [i ].ctrl -> error_status );
346346 if (error_status )
347- shost_printk (KERN_ERR , fnic -> lport -> host ,
348- "WQ[%d] error_status"
349- " %d\n" , i , error_status );
347+ dev_err (& fnic -> pdev -> dev , "WQ[%d] error_status %d\n" , i , error_status );
350348 }
351349
352350 for (i = 0 ; i < fnic -> rq_count ; i ++ ) {
353351 error_status = ioread32 (& fnic -> rq [i ].ctrl -> error_status );
354352 if (error_status )
355- shost_printk (KERN_ERR , fnic -> lport -> host ,
356- "RQ[%d] error_status"
357- " %d\n" , i , error_status );
353+ dev_err (& fnic -> pdev -> dev , "RQ[%d] error_status %d\n" , i , error_status );
358354 }
359355
360356 for (i = 0 ; i < fnic -> wq_copy_count ; i ++ ) {
361357 error_status = ioread32 (& fnic -> hw_copy_wq [i ].ctrl -> error_status );
362358 if (error_status )
363- shost_printk (KERN_ERR , fnic -> lport -> host ,
364- "CWQ[%d] error_status"
365- " %d\n" , i , error_status );
359+ dev_err (& fnic -> pdev -> dev , "CWQ[%d] error_status %d\n" , i , error_status );
366360 }
367361}
368362
@@ -396,8 +390,7 @@ static int fnic_notify_set(struct fnic *fnic)
396390 err = vnic_dev_notify_set (fnic -> vdev , fnic -> wq_copy_count + fnic -> copy_wq_base );
397391 break ;
398392 default :
399- shost_printk (KERN_ERR , fnic -> lport -> host ,
400- "Interrupt mode should be set up"
393+ dev_err (& fnic -> pdev -> dev , "Interrupt mode should be set up"
401394 " before devcmd notify set %d\n" ,
402395 vnic_dev_get_intr_mode (fnic -> vdev ));
403396 err = -1 ;
@@ -567,12 +560,10 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
567560
568561 host -> nr_hw_queues = fnic -> wq_copy_count ;
569562
570- shost_printk (KERN_INFO , host ,
571- "fnic: can_queue: %d max_lun: %llu" ,
563+ dev_info (& fnic -> pdev -> dev , "fnic: can_queue: %d max_lun: %llu" ,
572564 host -> can_queue , host -> max_lun );
573565
574- shost_printk (KERN_INFO , host ,
575- "fnic: max_id: %d max_cmd_len: %d nr_hw_queues: %d" ,
566+ dev_info (& fnic -> pdev -> dev , "fnic: max_id: %d max_cmd_len: %d nr_hw_queues: %d" ,
576567 host -> max_id , host -> max_cmd_len , host -> nr_hw_queues );
577568
578569 return 0 ;
@@ -622,7 +613,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
622613 */
623614 lp = libfc_host_alloc (& fnic_host_template , sizeof (struct fnic ));
624615 if (!lp ) {
625- printk ( KERN_ERR PFX "Unable to alloc libfc local port\n" );
616+ dev_err ( & pdev -> dev , "Unable to alloc libfc local port\n" );
626617 err = - ENOMEM ;
627618 goto err_out ;
628619 }
@@ -632,7 +623,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
632623
633624 fnic_id = ida_alloc (& fnic_ida , GFP_KERNEL );
634625 if (fnic_id < 0 ) {
635- pr_err ( "Unable to alloc fnic ID\n" );
626+ dev_err ( & pdev -> dev , "Unable to alloc fnic ID\n" );
636627 err = fnic_id ;
637628 goto err_out_ida_alloc ;
638629 }
@@ -650,15 +641,13 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
650641
651642 err = pci_enable_device (pdev );
652643 if (err ) {
653- shost_printk (KERN_ERR , fnic -> lport -> host ,
654- "Cannot enable PCI device, aborting.\n" );
644+ dev_err (& fnic -> pdev -> dev , "Cannot enable PCI device, aborting.\n" );
655645 goto err_out_free_hba ;
656646 }
657647
658648 err = pci_request_regions (pdev , DRV_NAME );
659649 if (err ) {
660- shost_printk (KERN_ERR , fnic -> lport -> host ,
661- "Cannot enable PCI resources, aborting\n" );
650+ dev_err (& fnic -> pdev -> dev , "Cannot enable PCI resources, aborting\n" );
662651 goto err_out_disable_device ;
663652 }
664653
@@ -672,17 +661,15 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
672661 if (err ) {
673662 err = dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (32 ));
674663 if (err ) {
675- shost_printk (KERN_ERR , fnic -> lport -> host ,
676- "No usable DMA configuration "
664+ dev_err (& fnic -> pdev -> dev , "No usable DMA configuration "
677665 "aborting\n" );
678666 goto err_out_release_regions ;
679667 }
680668 }
681669
682670 /* Map vNIC resources from BAR0 */
683671 if (!(pci_resource_flags (pdev , 0 ) & IORESOURCE_MEM )) {
684- shost_printk (KERN_ERR , fnic -> lport -> host ,
685- "BAR0 not memory-map'able, aborting.\n" );
672+ dev_err (& fnic -> pdev -> dev , "BAR0 not memory-map'able, aborting.\n" );
686673 err = - ENODEV ;
687674 goto err_out_release_regions ;
688675 }
@@ -692,49 +679,43 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
692679 fnic -> bar0 .len = pci_resource_len (pdev , 0 );
693680
694681 if (!fnic -> bar0 .vaddr ) {
695- shost_printk (KERN_ERR , fnic -> lport -> host ,
696- "Cannot memory-map BAR0 res hdr, "
682+ dev_err (& fnic -> pdev -> dev , "Cannot memory-map BAR0 res hdr, "
697683 "aborting.\n" );
698684 err = - ENODEV ;
699685 goto err_out_release_regions ;
700686 }
701687
702688 fnic -> vdev = vnic_dev_register (NULL , fnic , pdev , & fnic -> bar0 );
703689 if (!fnic -> vdev ) {
704- shost_printk (KERN_ERR , fnic -> lport -> host ,
705- "vNIC registration failed, "
690+ dev_err (& fnic -> pdev -> dev , "vNIC registration failed, "
706691 "aborting.\n" );
707692 err = - ENODEV ;
708693 goto err_out_iounmap ;
709694 }
710695
711696 err = vnic_dev_cmd_init (fnic -> vdev );
712697 if (err ) {
713- shost_printk (KERN_ERR , fnic -> lport -> host ,
714- "vnic_dev_cmd_init() returns %d, aborting\n" ,
698+ dev_err (& fnic -> pdev -> dev , "vnic_dev_cmd_init() returns %d, aborting\n" ,
715699 err );
716700 goto err_out_vnic_unregister ;
717701 }
718702
719703 err = fnic_dev_wait (fnic -> vdev , vnic_dev_open ,
720704 vnic_dev_open_done , CMD_OPENF_RQ_ENABLE_THEN_POST );
721705 if (err ) {
722- shost_printk (KERN_ERR , fnic -> lport -> host ,
723- "vNIC dev open failed, aborting.\n" );
706+ dev_err (& fnic -> pdev -> dev , "vNIC dev open failed, aborting.\n" );
724707 goto err_out_dev_cmd_deinit ;
725708 }
726709
727710 err = vnic_dev_init (fnic -> vdev , 0 );
728711 if (err ) {
729- shost_printk (KERN_ERR , fnic -> lport -> host ,
730- "vNIC dev init failed, aborting.\n" );
712+ dev_err (& fnic -> pdev -> dev , "vNIC dev init failed, aborting.\n" );
731713 goto err_out_dev_close ;
732714 }
733715
734716 err = vnic_dev_mac_addr (fnic -> vdev , fnic -> ctlr .ctl_src_addr );
735717 if (err ) {
736- shost_printk (KERN_ERR , fnic -> lport -> host ,
737- "vNIC get MAC addr failed \n" );
718+ dev_err (& fnic -> pdev -> dev , "vNIC get MAC addr failed\n" );
738719 goto err_out_dev_close ;
739720 }
740721 /* set data_src for point-to-point mode and to keep it non-zero */
@@ -743,8 +724,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
743724 /* Get vNIC configuration */
744725 err = fnic_get_vnic_config (fnic );
745726 if (err ) {
746- shost_printk (KERN_ERR , fnic -> lport -> host ,
747- "Get vNIC configuration failed, "
727+ dev_err (& fnic -> pdev -> dev , "Get vNIC configuration failed, "
748728 "aborting.\n" );
749729 goto err_out_dev_close ;
750730 }
@@ -756,16 +736,14 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
756736
757737 err = fnic_set_intr_mode (fnic );
758738 if (err ) {
759- shost_printk (KERN_ERR , fnic -> lport -> host ,
760- "Failed to set intr mode, "
739+ dev_err (& fnic -> pdev -> dev , "Failed to set intr mode, "
761740 "aborting.\n" );
762741 goto err_out_dev_close ;
763742 }
764743
765744 err = fnic_alloc_vnic_resources (fnic );
766745 if (err ) {
767- shost_printk (KERN_ERR , fnic -> lport -> host ,
768- "Failed to alloc vNIC resources, "
746+ dev_err (& fnic -> pdev -> dev , "Failed to alloc vNIC resources, "
769747 "aborting.\n" );
770748 goto err_out_clear_intr ;
771749 }
@@ -778,7 +756,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
778756 kzalloc ((fnic -> sw_copy_wq [hwq ].ioreq_table_size + 1 ) *
779757 sizeof (struct fnic_io_req * ), GFP_KERNEL );
780758 }
781- shost_printk ( KERN_INFO , fnic -> lport -> host , "fnic copy wqs: %d, Q0 ioreq table size: %d\n" ,
759+ dev_info ( & fnic -> pdev -> dev , "fnic copy wqs: %d, Q0 ioreq table size: %d\n" ,
782760 fnic -> wq_copy_count , fnic -> sw_copy_wq [0 ].ioreq_table_size );
783761
784762 /* initialize all fnic locks */
@@ -818,8 +796,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
818796 fnic -> ctlr .update_mac = fnic_update_mac ;
819797 fnic -> ctlr .get_src_addr = fnic_get_mac ;
820798 if (fnic -> config .flags & VFCF_FIP_CAPABLE ) {
821- shost_printk (KERN_INFO , fnic -> lport -> host ,
822- "firmware supports FIP\n" );
799+ dev_info (& fnic -> pdev -> dev , "firmware supports FIP\n" );
823800 /* enable directed and multicast */
824801 vnic_dev_packet_filter (fnic -> vdev , 1 , 1 , 0 , 0 , 0 );
825802 vnic_dev_add_addr (fnic -> vdev , FIP_ALL_ENODE_MACS );
@@ -834,8 +811,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
834811 INIT_LIST_HEAD (& fnic -> evlist );
835812 INIT_LIST_HEAD (& fnic -> vlans );
836813 } else {
837- shost_printk (KERN_INFO , fnic -> lport -> host ,
838- "firmware uses non-FIP mode\n" );
814+ dev_info (& fnic -> pdev -> dev , "firmware uses non-FIP mode\n" );
839815 fcoe_ctlr_init (& fnic -> ctlr , FIP_MODE_NON_FIP );
840816 fnic -> ctlr .state = FIP_ST_NON_FIP ;
841817 }
@@ -850,8 +826,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
850826 /* Setup notification buffer area */
851827 err = fnic_notify_set (fnic );
852828 if (err ) {
853- shost_printk (KERN_ERR , fnic -> lport -> host ,
854- "Failed to alloc notify buffer, aborting.\n" );
829+ dev_err (& fnic -> pdev -> dev , "Failed to alloc notify buffer, aborting.\n" );
855830 goto err_out_free_max_pool ;
856831 }
857832
@@ -863,8 +838,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
863838 for (i = 0 ; i < fnic -> rq_count ; i ++ ) {
864839 err = vnic_rq_fill (& fnic -> rq [i ], fnic_alloc_rq_frame );
865840 if (err ) {
866- shost_printk (KERN_ERR , fnic -> lport -> host ,
867- "fnic_alloc_rq_frame can't alloc "
841+ dev_err (& fnic -> pdev -> dev , "fnic_alloc_rq_frame can't alloc "
868842 "frame\n" );
869843 goto err_out_rq_buf ;
870844 }
@@ -882,8 +856,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
882856
883857 err = fnic_request_intr (fnic );
884858 if (err ) {
885- shost_printk (KERN_ERR , fnic -> lport -> host ,
886- "Unable to request irq.\n" );
859+ dev_err (& fnic -> pdev -> dev , "Unable to request irq.\n" );
887860 goto err_out_request_intr ;
888861 }
889862
@@ -893,8 +866,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
893866 */
894867 err = scsi_add_host (lp -> host , & pdev -> dev );
895868 if (err ) {
896- shost_printk (KERN_ERR , fnic -> lport -> host ,
897- "fnic: scsi_add_host failed...exiting\n" );
869+ dev_err (& fnic -> pdev -> dev , "fnic: scsi_add_host failed...exiting\n" );
898870 goto err_out_scsi_add_host ;
899871 }
900872
0 commit comments