Make ieee1394_init a fs-initcall
[sfrench/cifs-2.6.git] / drivers / ieee1394 / ieee1394_core.c
index 36c747b277d0a2b66ab26b89da98a371ad549142..87233800372182916a51caaebbc3b06f89472963 100644 (file)
@@ -242,7 +242,7 @@ int hpsb_bus_reset(struct hpsb_host *host)
 {
        if (host->in_bus_reset) {
                HPSB_NOTICE("%s called while bus reset already in progress",
-                           __FUNCTION__);
+                           __func__);
                return 1;
        }
 
@@ -338,6 +338,7 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
        u8 cldcnt[nodecount];
        u8 *map = host->speed_map;
        u8 *speedcap = host->speed;
+       u8 local_link_speed = host->csr.lnk_spd;
        struct selfid *sid;
        struct ext_selfid *esid;
        int i, j, n;
@@ -373,6 +374,8 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
                        if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++;
 
                        speedcap[n] = sid->speed;
+                       if (speedcap[n] > local_link_speed)
+                               speedcap[n] = local_link_speed;
                        n--;
                }
        }
@@ -405,12 +408,11 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
                }
        }
 
-#if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX
-       /* assume maximum speed for 1394b PHYs, nodemgr will correct it */
-       for (n = 0; n < nodecount; n++)
-               if (speedcap[n] == SELFID_SPEED_UNKNOWN)
-                       speedcap[n] = IEEE1394_SPEED_MAX;
-#endif
+       /* assume a maximum speed for 1394b PHYs, nodemgr will correct it */
+       if (local_link_speed > SELFID_SPEED_UNKNOWN)
+               for (i = 0; i < nodecount; i++)
+                       if (speedcap[i] == SELFID_SPEED_UNKNOWN)
+                               speedcap[i] = local_link_speed;
 }
 
 
@@ -1273,7 +1275,7 @@ static void __exit ieee1394_cleanup(void)
        unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
 }
 
-module_init(ieee1394_init);
+fs_initcall(ieee1394_init);
 module_exit(ieee1394_cleanup);
 
 /* Exported symbols */
@@ -1312,6 +1314,7 @@ EXPORT_SYMBOL(hpsb_make_lock64packet);
 EXPORT_SYMBOL(hpsb_make_phypacket);
 EXPORT_SYMBOL(hpsb_read);
 EXPORT_SYMBOL(hpsb_write);
+EXPORT_SYMBOL(hpsb_lock);
 EXPORT_SYMBOL(hpsb_packet_success);
 
 /** highlevel.c **/