of: Always use 'struct device.of_node' to get device node pointer.
[safe/jmp/linux-2.6] / arch / powerpc / kernel / of_device.c
index fa983a5..285c849 100644 (file)
@@ -13,7 +13,7 @@
 static void of_device_make_bus_id(struct of_device *dev)
 {
        static atomic_t bus_no_reg_magic;
-       struct device_node *node = dev->node;
+       struct device_node *node = dev->dev.of_node;
        const u32 *reg;
        u64 addr;
        int magic;
@@ -74,9 +74,10 @@ struct of_device *of_device_alloc(struct device_node *np,
        dev->dev.parent = parent;
        dev->dev.release = of_release_dev;
        dev->dev.archdata.of_node = np;
+       dev->dev.of_node = np;
 
        if (bus_id)
-               dev_set_name(&dev->dev, bus_id);
+               dev_set_name(&dev->dev, "%s", bus_id);
        else
                of_device_make_bus_id(dev);
 
@@ -95,17 +96,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 
        ofdev = to_of_device(dev);
 
-       if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name))
+       if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name))
                return -ENOMEM;
 
-       if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type))
+       if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type))
                return -ENOMEM;
 
         /* Since the compatible field can contain pretty much anything
          * it's not really legal to split it out with commas. We split it
          * up using a number of environment variables instead. */
 
-       compat = of_get_property(ofdev->node, "compatible", &cplen);
+       compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen);
        while (compat && *compat && cplen > 0) {
                if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
                        return -ENOMEM;