@@ -344,25 +344,19 @@ void fnic_log_q_error(struct fnic *fnic)
344
344
for (i = 0 ; i < fnic -> raw_wq_count ; i ++ ) {
345
345
error_status = ioread32 (& fnic -> wq [i ].ctrl -> error_status );
346
346
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 );
350
348
}
351
349
352
350
for (i = 0 ; i < fnic -> rq_count ; i ++ ) {
353
351
error_status = ioread32 (& fnic -> rq [i ].ctrl -> error_status );
354
352
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 );
358
354
}
359
355
360
356
for (i = 0 ; i < fnic -> wq_copy_count ; i ++ ) {
361
357
error_status = ioread32 (& fnic -> hw_copy_wq [i ].ctrl -> error_status );
362
358
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 );
366
360
}
367
361
}
368
362
@@ -396,8 +390,7 @@ static int fnic_notify_set(struct fnic *fnic)
396
390
err = vnic_dev_notify_set (fnic -> vdev , fnic -> wq_copy_count + fnic -> copy_wq_base );
397
391
break ;
398
392
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"
401
394
" before devcmd notify set %d\n" ,
402
395
vnic_dev_get_intr_mode (fnic -> vdev ));
403
396
err = -1 ;
@@ -567,12 +560,10 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
567
560
568
561
host -> nr_hw_queues = fnic -> wq_copy_count ;
569
562
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" ,
572
564
host -> can_queue , host -> max_lun );
573
565
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" ,
576
567
host -> max_id , host -> max_cmd_len , host -> nr_hw_queues );
577
568
578
569
return 0 ;
@@ -622,7 +613,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
622
613
*/
623
614
lp = libfc_host_alloc (& fnic_host_template , sizeof (struct fnic ));
624
615
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" );
626
617
err = - ENOMEM ;
627
618
goto err_out ;
628
619
}
@@ -632,7 +623,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
632
623
633
624
fnic_id = ida_alloc (& fnic_ida , GFP_KERNEL );
634
625
if (fnic_id < 0 ) {
635
- pr_err ( "Unable to alloc fnic ID\n" );
626
+ dev_err ( & pdev -> dev , "Unable to alloc fnic ID\n" );
636
627
err = fnic_id ;
637
628
goto err_out_ida_alloc ;
638
629
}
@@ -650,15 +641,13 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
650
641
651
642
err = pci_enable_device (pdev );
652
643
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" );
655
645
goto err_out_free_hba ;
656
646
}
657
647
658
648
err = pci_request_regions (pdev , DRV_NAME );
659
649
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" );
662
651
goto err_out_disable_device ;
663
652
}
664
653
@@ -672,17 +661,15 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
672
661
if (err ) {
673
662
err = dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (32 ));
674
663
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 "
677
665
"aborting\n" );
678
666
goto err_out_release_regions ;
679
667
}
680
668
}
681
669
682
670
/* Map vNIC resources from BAR0 */
683
671
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" );
686
673
err = - ENODEV ;
687
674
goto err_out_release_regions ;
688
675
}
@@ -692,49 +679,43 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
692
679
fnic -> bar0 .len = pci_resource_len (pdev , 0 );
693
680
694
681
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, "
697
683
"aborting.\n" );
698
684
err = - ENODEV ;
699
685
goto err_out_release_regions ;
700
686
}
701
687
702
688
fnic -> vdev = vnic_dev_register (NULL , fnic , pdev , & fnic -> bar0 );
703
689
if (!fnic -> vdev ) {
704
- shost_printk (KERN_ERR , fnic -> lport -> host ,
705
- "vNIC registration failed, "
690
+ dev_err (& fnic -> pdev -> dev , "vNIC registration failed, "
706
691
"aborting.\n" );
707
692
err = - ENODEV ;
708
693
goto err_out_iounmap ;
709
694
}
710
695
711
696
err = vnic_dev_cmd_init (fnic -> vdev );
712
697
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" ,
715
699
err );
716
700
goto err_out_vnic_unregister ;
717
701
}
718
702
719
703
err = fnic_dev_wait (fnic -> vdev , vnic_dev_open ,
720
704
vnic_dev_open_done , CMD_OPENF_RQ_ENABLE_THEN_POST );
721
705
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" );
724
707
goto err_out_dev_cmd_deinit ;
725
708
}
726
709
727
710
err = vnic_dev_init (fnic -> vdev , 0 );
728
711
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" );
731
713
goto err_out_dev_close ;
732
714
}
733
715
734
716
err = vnic_dev_mac_addr (fnic -> vdev , fnic -> ctlr .ctl_src_addr );
735
717
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" );
738
719
goto err_out_dev_close ;
739
720
}
740
721
/* 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)
743
724
/* Get vNIC configuration */
744
725
err = fnic_get_vnic_config (fnic );
745
726
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, "
748
728
"aborting.\n" );
749
729
goto err_out_dev_close ;
750
730
}
@@ -756,16 +736,14 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
756
736
757
737
err = fnic_set_intr_mode (fnic );
758
738
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, "
761
740
"aborting.\n" );
762
741
goto err_out_dev_close ;
763
742
}
764
743
765
744
err = fnic_alloc_vnic_resources (fnic );
766
745
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, "
769
747
"aborting.\n" );
770
748
goto err_out_clear_intr ;
771
749
}
@@ -778,7 +756,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
778
756
kzalloc ((fnic -> sw_copy_wq [hwq ].ioreq_table_size + 1 ) *
779
757
sizeof (struct fnic_io_req * ), GFP_KERNEL );
780
758
}
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" ,
782
760
fnic -> wq_copy_count , fnic -> sw_copy_wq [0 ].ioreq_table_size );
783
761
784
762
/* initialize all fnic locks */
@@ -818,8 +796,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
818
796
fnic -> ctlr .update_mac = fnic_update_mac ;
819
797
fnic -> ctlr .get_src_addr = fnic_get_mac ;
820
798
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" );
823
800
/* enable directed and multicast */
824
801
vnic_dev_packet_filter (fnic -> vdev , 1 , 1 , 0 , 0 , 0 );
825
802
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)
834
811
INIT_LIST_HEAD (& fnic -> evlist );
835
812
INIT_LIST_HEAD (& fnic -> vlans );
836
813
} 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" );
839
815
fcoe_ctlr_init (& fnic -> ctlr , FIP_MODE_NON_FIP );
840
816
fnic -> ctlr .state = FIP_ST_NON_FIP ;
841
817
}
@@ -850,8 +826,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
850
826
/* Setup notification buffer area */
851
827
err = fnic_notify_set (fnic );
852
828
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" );
855
830
goto err_out_free_max_pool ;
856
831
}
857
832
@@ -863,8 +838,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
863
838
for (i = 0 ; i < fnic -> rq_count ; i ++ ) {
864
839
err = vnic_rq_fill (& fnic -> rq [i ], fnic_alloc_rq_frame );
865
840
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 "
868
842
"frame\n" );
869
843
goto err_out_rq_buf ;
870
844
}
@@ -882,8 +856,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
882
856
883
857
err = fnic_request_intr (fnic );
884
858
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" );
887
860
goto err_out_request_intr ;
888
861
}
889
862
@@ -893,8 +866,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
893
866
*/
894
867
err = scsi_add_host (lp -> host , & pdev -> dev );
895
868
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" );
898
870
goto err_out_scsi_add_host ;
899
871
}
900
872
0 commit comments