Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[safe/jmp/linux-2.6] / drivers / ieee1394 / nodemgr.c
index f47b6f6..1835021 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/bitmap.h>
 #include <linux/kernel.h>
+#include <linux/kmemcheck.h>
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
@@ -18,7 +19,6 @@
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
 #include <linux/freezer.h>
-#include <linux/semaphore.h>
 #include <asm/atomic.h>
 
 #include "csr.h"
@@ -39,7 +39,10 @@ struct nodemgr_csr_info {
        struct hpsb_host *host;
        nodeid_t nodeid;
        unsigned int generation;
+
+       kmemcheck_bitfield_begin(flags);
        unsigned int speed_unverified:1;
+       kmemcheck_bitfield_end(flags);
 };
 
 
@@ -484,7 +487,7 @@ static struct device_attribute *const fw_host_attrs[] = {
 static ssize_t fw_show_drv_device_ids(struct device_driver *drv, char *buf)
 {
        struct hpsb_protocol_driver *driver;
-       struct ieee1394_device_id *id;
+       const struct ieee1394_device_id *id;
        int length = 0;
        char *scratch = buf;
 
@@ -658,7 +661,7 @@ static int nodemgr_bus_match(struct device * dev, struct device_driver * drv)
 {
        struct hpsb_protocol_driver *driver;
        struct unit_directory *ud;
-       struct ieee1394_device_id *id;
+       const struct ieee1394_device_id *id;
 
        /* We only match unit directories */
        if (dev->platform_data != &nodemgr_ud_platform_data)
@@ -971,6 +974,9 @@ static struct unit_directory *nodemgr_process_unit_directory
        ud->ud_kv = ud_kv;
        ud->id = (*id)++;
 
+       /* inherit vendor_id from root directory if none exists in unit dir */
+       ud->vendor_id = ne->vendor_id;
+
        csr1212_for_each_dir_entry(ne->csr, kv, ud_kv, dentry) {
                switch (kv->key.id) {
                case CSR1212_KV_ID_VENDOR:
@@ -1290,6 +1296,7 @@ static void nodemgr_node_scan_one(struct hpsb_host *host,
        u8 *speed;
 
        ci = kmalloc(sizeof(*ci), GFP_KERNEL);
+       kmemcheck_annotate_bitfield(ci, flags);
        if (!ci)
                return;
 
@@ -1389,9 +1396,9 @@ static int update_pdrv(struct device *dev, void *data)
                        pdrv = container_of(drv, struct hpsb_protocol_driver,
                                            driver);
                        if (pdrv->update) {
-                               down(&ud->device.sem);
+                               device_lock(&ud->device);
                                error = pdrv->update(ud);
-                               up(&ud->device.sem);
+                               device_unlock(&ud->device);
                        }
                        if (error)
                                device_release_driver(&ud->device);