[SCSI] libfc, fcoe, bnx2fc: cleanup fcoe_dev_stats
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / scsi / fcoe / fcoe_transport.c
index 710e149..861c09f 100644 (file)
@@ -89,7 +89,7 @@ void __fcoe_get_lesb(struct fc_lport *lport,
 {
        unsigned int cpu;
        u32 lfc, vlfc, mdac;
-       struct fcoe_dev_stats *devst;
+       struct fc_stats *stats;
        struct fcoe_fc_els_lesb *lesb;
        struct rtnl_link_stats64 temp;
 
@@ -99,10 +99,10 @@ void __fcoe_get_lesb(struct fc_lport *lport,
        lesb = (struct fcoe_fc_els_lesb *)fc_lesb;
        memset(lesb, 0, sizeof(*lesb));
        for_each_possible_cpu(cpu) {
-               devst = per_cpu_ptr(lport->dev_stats, cpu);
-               lfc += devst->LinkFailureCount;
-               vlfc += devst->VLinkFailureCount;
-               mdac += devst->MissDiscAdvCount;
+               stats = per_cpu_ptr(lport->stats, cpu);
+               lfc += stats->LinkFailureCount;
+               vlfc += stats->VLinkFailureCount;
+               mdac += stats->MissDiscAdvCount;
        }
        lesb->lesb_link_fail = htonl(lfc);
        lesb->lesb_vlink_fail = htonl(vlfc);
@@ -815,9 +815,17 @@ out_nodev:
  */
 static int __init libfcoe_init(void)
 {
-       fcoe_transport_init();
+       int rc = 0;
 
-       return 0;
+       rc = fcoe_transport_init();
+       if (rc)
+               return rc;
+
+       rc = fcoe_sysfs_setup();
+       if (rc)
+               fcoe_transport_exit();
+
+       return rc;
 }
 module_init(libfcoe_init);
 
@@ -826,6 +834,7 @@ module_init(libfcoe_init);
  */
 static void __exit libfcoe_exit(void)
 {
+       fcoe_sysfs_teardown();
        fcoe_transport_exit();
 }
 module_exit(libfcoe_exit);