w1: fix omap 1-wire driver compilation
[safe/jmp/linux-2.6] / drivers / ieee1394 / ieee1394_core.c
index 0fc8c6e..8723380 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/moduleparam.h>
 #include <linux/bitops.h>
 #include <linux/kdev_t.h>
+#include <linux/freezer.h>
 #include <linux/suspend.h>
 #include <linux/kthread.h>
 #include <linux/preempt.h>
@@ -241,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;
        }
 
@@ -337,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;
@@ -372,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--;
                }
        }
@@ -404,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;
 }
 
 
@@ -487,7 +490,7 @@ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
        highlevel_host_reset(host);
 }
 
-static spinlock_t pending_packets_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pending_packets_lock);
 
 /**
  * hpsb_packet_sent - notify core of sending a packet
@@ -1128,8 +1131,6 @@ static int hpsbpkt_thread(void *__hi)
        struct list_head tmp;
        int may_schedule;
 
-       current->flags |= PF_NOFREEZE;
-
        while (!kthread_should_stop()) {
 
                INIT_LIST_HEAD(&tmp);
@@ -1274,7 +1275,7 @@ static void __exit ieee1394_cleanup(void)
        unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
 }
 
-fs_initcall(ieee1394_init); /* same as ohci1394 */
+fs_initcall(ieee1394_init);
 module_exit(ieee1394_cleanup);
 
 /* Exported symbols */
@@ -1313,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 **/