Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6

* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  of: change of_match_device to work with struct device
  of: Remove duplicate fields from of_platform_driver
  drivercore: Add of_match_table to the common device drivers
  arch/microblaze: Move dma_mask from of_device into pdev_archdata
  arch/powerpc: Move dma_mask from of_device into pdev_archdata
  of: eliminate of_device->node and dev_archdata->{of,prom}_node
  of: Always use 'struct device.of_node' to get device node pointer.
  i2c/of: Allow device node to be passed via i2c_board_info
  driver-core: Add device node pointer to struct device
  of: protect contents of of_platform.h and of_device.h
  of/flattree: Make unflatten_device_tree() safe to call from any arch
  of/flattree: make of_fdt.h safe to unconditionally include.
This commit is contained in:
Linus Torvalds 2010-05-24 07:37:38 -07:00
commit 62a11ae340
211 changed files with 1254 additions and 974 deletions

View file

@ -12,29 +12,15 @@
struct device_node; struct device_node;
struct dev_archdata { struct dev_archdata {
/* Optional pointer to an OF device node */
struct device_node *of_node;
/* DMA operations on that device */ /* DMA operations on that device */
struct dma_map_ops *dma_ops; struct dma_map_ops *dma_ops;
void *dma_data; void *dma_data;
}; };
struct pdev_archdata { struct pdev_archdata {
u64 dma_mask;
}; };
static inline void dev_archdata_set_node(struct dev_archdata *ad,
struct device_node *np)
{
ad->of_node = np;
}
static inline struct device_node *
dev_archdata_get_node(const struct dev_archdata *ad)
{
return ad->of_node;
}
#endif /* _ASM_MICROBLAZE_DEVICE_H */ #endif /* _ASM_MICROBLAZE_DEVICE_H */

View file

@ -21,9 +21,8 @@
* probed using OF properties. * probed using OF properties.
*/ */
struct of_device { struct of_device {
struct device_node *node; /* to be obsoleted */
u64 dma_mask; /* DMA mask */
struct device dev; /* Generic device interface */ struct device dev; /* Generic device interface */
struct pdev_archdata archdata;
}; };
extern ssize_t of_device_get_modalias(struct of_device *ofdev, extern ssize_t of_device_get_modalias(struct of_device *ofdev,

View file

@ -12,7 +12,7 @@
void of_device_make_bus_id(struct of_device *dev) void of_device_make_bus_id(struct of_device *dev)
{ {
static atomic_t bus_no_reg_magic; static atomic_t bus_no_reg_magic;
struct device_node *node = dev->node; struct device_node *node = dev->dev.of_node;
const u32 *reg; const u32 *reg;
u64 addr; u64 addr;
int magic; int magic;
@ -49,11 +49,10 @@ struct of_device *of_device_alloc(struct device_node *np,
if (!dev) if (!dev)
return NULL; return NULL;
dev->node = of_node_get(np); dev->dev.of_node = of_node_get(np);
dev->dev.dma_mask = &dev->dma_mask; dev->dev.dma_mask = &dev->archdata.dma_mask;
dev->dev.parent = parent; dev->dev.parent = parent;
dev->dev.release = of_release_dev; dev->dev.release = of_release_dev;
dev->dev.archdata.of_node = np;
if (bus_id) if (bus_id)
dev_set_name(&dev->dev, bus_id); dev_set_name(&dev->dev, bus_id);
@ -75,17 +74,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
ofdev = to_of_device(dev); 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; 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; return -ENOMEM;
/* Since the compatible field can contain pretty much anything /* Since the compatible field can contain pretty much anything
* it's not really legal to split it out with commas. We split it * it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */ * 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) { while (compat && *compat && cplen > 0) {
if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
return -ENOMEM; return -ENOMEM;

View file

@ -47,7 +47,7 @@ struct of_device *of_platform_device_create(struct device_node *np,
if (!dev) if (!dev)
return NULL; return NULL;
dev->dma_mask = 0xffffffffUL; dev->archdata.dma_mask = 0xffffffffUL;
dev->dev.bus = &of_platform_bus_type; dev->dev.bus = &of_platform_bus_type;
/* We do not fill the DMA ops for platform devices by default. /* We do not fill the DMA ops for platform devices by default.
@ -166,7 +166,7 @@ EXPORT_SYMBOL(of_platform_bus_probe);
static int of_dev_node_match(struct device *dev, void *data) static int of_dev_node_match(struct device *dev, void *data)
{ {
return to_of_device(dev)->node == data; return to_of_device(dev)->dev.of_node == data;
} }
struct of_device *of_find_device_by_node(struct device_node *np) struct of_device *of_find_device_by_node(struct device_node *np)
@ -184,7 +184,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
static int of_dev_phandle_match(struct device *dev, void *data) static int of_dev_phandle_match(struct device *dev, void *data)
{ {
phandle *ph = data; phandle *ph = data;
return to_of_device(dev)->node->phandle == *ph; return to_of_device(dev)->dev.of_node->phandle == *ph;
} }
struct of_device *of_find_device_by_phandle(phandle ph) struct of_device *of_find_device_by_phandle(phandle ph)

View file

@ -10,9 +10,6 @@ struct dma_map_ops;
struct device_node; struct device_node;
struct dev_archdata { struct dev_archdata {
/* Optional pointer to an OF device node */
struct device_node *of_node;
/* DMA operations on that device */ /* DMA operations on that device */
struct dma_map_ops *dma_ops; struct dma_map_ops *dma_ops;
@ -30,19 +27,8 @@ struct dev_archdata {
#endif #endif
}; };
static inline void dev_archdata_set_node(struct dev_archdata *ad,
struct device_node *np)
{
ad->of_node = np;
}
static inline struct device_node *
dev_archdata_get_node(const struct dev_archdata *ad)
{
return ad->of_node;
}
struct pdev_archdata { struct pdev_archdata {
u64 dma_mask;
}; };
#endif /* _ASM_POWERPC_DEVICE_H */ #endif /* _ASM_POWERPC_DEVICE_H */

View file

@ -108,7 +108,7 @@ static inline void* macio_get_drvdata(struct macio_dev *dev)
static inline struct device_node *macio_get_of_node(struct macio_dev *mdev) static inline struct device_node *macio_get_of_node(struct macio_dev *mdev)
{ {
return mdev->ofdev.node; return mdev->ofdev.dev.of_node;
} }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI

View file

@ -12,9 +12,8 @@
*/ */
struct of_device struct of_device
{ {
struct device_node *node; /* to be obsoleted */
u64 dma_mask; /* DMA mask */
struct device dev; /* Generic device interface */ struct device dev; /* Generic device interface */
struct pdev_archdata archdata;
}; };
extern struct of_device *of_device_alloc(struct device_node *np, extern struct of_device *of_device_alloc(struct device_node *np,

View file

@ -140,14 +140,14 @@ static struct dma_map_ops ibmebus_dma_ops = {
static int ibmebus_match_path(struct device *dev, void *data) static int ibmebus_match_path(struct device *dev, void *data)
{ {
struct device_node *dn = to_of_device(dev)->node; struct device_node *dn = to_of_device(dev)->dev.of_node;
return (dn->full_name && return (dn->full_name &&
(strcasecmp((char *)data, dn->full_name) == 0)); (strcasecmp((char *)data, dn->full_name) == 0));
} }
static int ibmebus_match_node(struct device *dev, void *data) static int ibmebus_match_node(struct device *dev, void *data)
{ {
return to_of_device(dev)->node == data; return to_of_device(dev)->dev.of_node == data;
} }
static int ibmebus_create_device(struct device_node *dn) static int ibmebus_create_device(struct device_node *dn)
@ -202,7 +202,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
int ibmebus_register_driver(struct of_platform_driver *drv) int ibmebus_register_driver(struct of_platform_driver *drv)
{ {
/* If the driver uses devices that ibmebus doesn't know, add them */ /* If the driver uses devices that ibmebus doesn't know, add them */
ibmebus_create_devices(drv->match_table); ibmebus_create_devices(drv->driver.of_match_table);
return of_register_driver(drv, &ibmebus_bus_type); return of_register_driver(drv, &ibmebus_bus_type);
} }

View file

@ -13,7 +13,7 @@
static void of_device_make_bus_id(struct of_device *dev) static void of_device_make_bus_id(struct of_device *dev)
{ {
static atomic_t bus_no_reg_magic; static atomic_t bus_no_reg_magic;
struct device_node *node = dev->node; struct device_node *node = dev->dev.of_node;
const u32 *reg; const u32 *reg;
u64 addr; u64 addr;
int magic; int magic;
@ -69,11 +69,10 @@ struct of_device *of_device_alloc(struct device_node *np,
if (!dev) if (!dev)
return NULL; return NULL;
dev->node = of_node_get(np); dev->dev.of_node = of_node_get(np);
dev->dev.dma_mask = &dev->dma_mask; dev->dev.dma_mask = &dev->archdata.dma_mask;
dev->dev.parent = parent; dev->dev.parent = parent;
dev->dev.release = of_release_dev; dev->dev.release = of_release_dev;
dev->dev.archdata.of_node = np;
if (bus_id) if (bus_id)
dev_set_name(&dev->dev, "%s", bus_id); dev_set_name(&dev->dev, "%s", bus_id);
@ -95,17 +94,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
ofdev = to_of_device(dev); 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; 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; return -ENOMEM;
/* Since the compatible field can contain pretty much anything /* Since the compatible field can contain pretty much anything
* it's not really legal to split it out with commas. We split it * it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */ * 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) { while (compat && *compat && cplen > 0) {
if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
return -ENOMEM; return -ENOMEM;

View file

@ -74,7 +74,7 @@ struct of_device* of_platform_device_create(struct device_node *np,
if (!dev) if (!dev)
return NULL; return NULL;
dev->dma_mask = 0xffffffffUL; dev->archdata.dma_mask = 0xffffffffUL;
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
dev->dev.bus = &of_platform_bus_type; dev->dev.bus = &of_platform_bus_type;
@ -195,7 +195,7 @@ EXPORT_SYMBOL(of_platform_bus_probe);
static int of_dev_node_match(struct device *dev, void *data) static int of_dev_node_match(struct device *dev, void *data)
{ {
return to_of_device(dev)->node == data; return to_of_device(dev)->dev.of_node == data;
} }
struct of_device *of_find_device_by_node(struct device_node *np) struct of_device *of_find_device_by_node(struct device_node *np)
@ -213,7 +213,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
static int of_dev_phandle_match(struct device *dev, void *data) static int of_dev_phandle_match(struct device *dev, void *data)
{ {
phandle *ph = data; phandle *ph = data;
return to_of_device(dev)->node->phandle == *ph; return to_of_device(dev)->dev.of_node->phandle == *ph;
} }
struct of_device *of_find_device_by_phandle(phandle ph) struct of_device *of_find_device_by_phandle(phandle ph)
@ -246,10 +246,10 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
if (ppc_md.pci_setup_phb == NULL) if (ppc_md.pci_setup_phb == NULL)
return -ENODEV; return -ENODEV;
printk(KERN_INFO "Setting up PCI bus %s\n", dev->node->full_name); pr_info("Setting up PCI bus %s\n", dev->dev.of_node->full_name);
/* Alloc and setup PHB data structure */ /* Alloc and setup PHB data structure */
phb = pcibios_alloc_controller(dev->node); phb = pcibios_alloc_controller(dev->dev.of_node);
if (!phb) if (!phb)
return -ENODEV; return -ENODEV;
@ -263,19 +263,19 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
} }
/* Process "ranges" property */ /* Process "ranges" property */
pci_process_bridge_OF_ranges(phb, dev->node, 0); pci_process_bridge_OF_ranges(phb, dev->dev.of_node, 0);
/* Init pci_dn data structures */ /* Init pci_dn data structures */
pci_devs_phb_init_dynamic(phb); pci_devs_phb_init_dynamic(phb);
/* Register devices with EEH */ /* Register devices with EEH */
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
if (dev->node->child) if (dev->dev.of_node->child)
eeh_add_device_tree_early(dev->node); eeh_add_device_tree_early(dev->dev.of_node);
#endif /* CONFIG_EEH */ #endif /* CONFIG_EEH */
/* Scan the bus */ /* Scan the bus */
pcibios_scan_phb(phb, dev->node); pcibios_scan_phb(phb, dev->dev.of_node);
if (phb->bus == NULL) if (phb->bus == NULL)
return -ENXIO; return -ENXIO;
@ -306,10 +306,11 @@ static struct of_device_id of_pci_phb_ids[] = {
}; };
static struct of_platform_driver of_pci_phb_driver = { static struct of_platform_driver of_pci_phb_driver = {
.match_table = of_pci_phb_ids,
.probe = of_pci_phb_probe, .probe = of_pci_phb_probe,
.driver = { .driver = {
.name = "of-pci", .name = "of-pci",
.owner = THIS_MODULE,
.of_match_table = of_pci_phb_ids,
}, },
}; };

View file

@ -1097,8 +1097,8 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
if (dev->is_added) if (dev->is_added)
continue; continue;
/* Setup OF node pointer in archdata */ /* Setup OF node pointer in the device */
sd->of_node = pci_device_to_OF_node(dev); dev->dev.of_node = pci_device_to_OF_node(dev);
/* Fixup NUMA node as it may not be setup yet by the generic /* Fixup NUMA node as it may not be setup yet by the generic
* code and is needed by the DMA init * code and is needed by the DMA init

View file

@ -707,7 +707,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev)
* Check to see that device has a DMA window and configure * Check to see that device has a DMA window and configure
* entitlement for the device. * entitlement for the device.
*/ */
if (of_get_property(viodev->dev.archdata.of_node, if (of_get_property(viodev->dev.of_node,
"ibm,my-dma-window", NULL)) { "ibm,my-dma-window", NULL)) {
/* Check that the driver is CMO enabled and get desired DMA */ /* Check that the driver is CMO enabled and get desired DMA */
if (!viodrv->get_desired_dma) { if (!viodrv->get_desired_dma) {
@ -1054,7 +1054,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
if (firmware_has_feature(FW_FEATURE_ISERIES)) if (firmware_has_feature(FW_FEATURE_ISERIES))
return vio_build_iommu_table_iseries(dev); return vio_build_iommu_table_iseries(dev);
dma_window = of_get_property(dev->dev.archdata.of_node, dma_window = of_get_property(dev->dev.of_node,
"ibm,my-dma-window", NULL); "ibm,my-dma-window", NULL);
if (!dma_window) if (!dma_window)
return NULL; return NULL;
@ -1063,7 +1063,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
if (tbl == NULL) if (tbl == NULL)
return NULL; return NULL;
of_parse_dma_window(dev->dev.archdata.of_node, dma_window, of_parse_dma_window(dev->dev.of_node, dma_window,
&tbl->it_index, &offset, &size); &tbl->it_index, &offset, &size);
/* TCE table size - measured in tce entries */ /* TCE table size - measured in tce entries */
@ -1091,7 +1091,7 @@ static const struct vio_device_id *vio_match_device(
{ {
while (ids->type[0] != '\0') { while (ids->type[0] != '\0') {
if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
of_device_is_compatible(dev->dev.archdata.of_node, of_device_is_compatible(dev->dev.of_node,
ids->compat)) ids->compat))
return ids; return ids;
ids++; ids++;
@ -1184,7 +1184,7 @@ EXPORT_SYMBOL(vio_unregister_driver);
static void __devinit vio_dev_release(struct device *dev) static void __devinit vio_dev_release(struct device *dev)
{ {
/* XXX should free TCE table */ /* XXX should free TCE table */
of_node_put(dev->archdata.of_node); of_node_put(dev->of_node);
kfree(to_vio_dev(dev)); kfree(to_vio_dev(dev));
} }
@ -1235,7 +1235,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
if (unit_address != NULL) if (unit_address != NULL)
viodev->unit_address = *unit_address; viodev->unit_address = *unit_address;
} }
viodev->dev.archdata.of_node = of_node_get(of_node); viodev->dev.of_node = of_node_get(of_node);
if (firmware_has_feature(FW_FEATURE_CMO)) if (firmware_has_feature(FW_FEATURE_CMO))
vio_cmo_set_dma_ops(viodev); vio_cmo_set_dma_ops(viodev);
@ -1320,7 +1320,7 @@ static ssize_t name_show(struct device *dev,
static ssize_t devspec_show(struct device *dev, static ssize_t devspec_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct device_node *of_node = dev->archdata.of_node; struct device_node *of_node = dev->of_node;
return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none"); return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
} }
@ -1332,7 +1332,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
struct device_node *dn; struct device_node *dn;
const char *cp; const char *cp;
dn = dev->archdata.of_node; dn = dev->of_node;
if (!dn) if (!dn)
return -ENODEV; return -ENODEV;
cp = of_get_property(dn, "compatible", NULL); cp = of_get_property(dn, "compatible", NULL);
@ -1370,7 +1370,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
struct device_node *dn; struct device_node *dn;
const char *cp; const char *cp;
dn = dev->archdata.of_node; dn = dev->of_node;
if (!dn) if (!dn)
return -ENODEV; return -ENODEV;
cp = of_get_property(dn, "compatible", NULL); cp = of_get_property(dn, "compatible", NULL);
@ -1402,7 +1402,7 @@ static struct bus_type vio_bus_type = {
*/ */
const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length)
{ {
return of_get_property(vdev->dev.archdata.of_node, which, length); return of_get_property(vdev->dev.of_node, which, length);
} }
EXPORT_SYMBOL(vio_get_attribute); EXPORT_SYMBOL(vio_get_attribute);

View file

@ -168,7 +168,7 @@ static int __devinit mpc52xx_wkup_gpiochip_probe(struct of_device *ofdev,
ofchip->gc.get = mpc52xx_wkup_gpio_get; ofchip->gc.get = mpc52xx_wkup_gpio_get;
ofchip->gc.set = mpc52xx_wkup_gpio_set; ofchip->gc.set = mpc52xx_wkup_gpio_set;
ret = of_mm_gpiochip_add(ofdev->node, &chip->mmchip); ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip);
if (ret) if (ret)
return ret; return ret;
@ -193,8 +193,11 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = {
}; };
static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = { static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = {
.name = "gpio_wkup", .driver = {
.match_table = mpc52xx_wkup_gpiochip_match, .name = "gpio_wkup",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_wkup_gpiochip_match,
},
.probe = mpc52xx_wkup_gpiochip_probe, .probe = mpc52xx_wkup_gpiochip_probe,
.remove = mpc52xx_gpiochip_remove, .remove = mpc52xx_gpiochip_remove,
}; };
@ -329,7 +332,7 @@ static int __devinit mpc52xx_simple_gpiochip_probe(struct of_device *ofdev,
ofchip->gc.get = mpc52xx_simple_gpio_get; ofchip->gc.get = mpc52xx_simple_gpio_get;
ofchip->gc.set = mpc52xx_simple_gpio_set; ofchip->gc.set = mpc52xx_simple_gpio_set;
ret = of_mm_gpiochip_add(ofdev->node, &chip->mmchip); ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip);
if (ret) if (ret)
return ret; return ret;
@ -349,8 +352,11 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = {
}; };
static struct of_platform_driver mpc52xx_simple_gpiochip_driver = { static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
.name = "gpio", .driver = {
.match_table = mpc52xx_simple_gpiochip_match, .name = "gpio",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_simple_gpiochip_match,
},
.probe = mpc52xx_simple_gpiochip_probe, .probe = mpc52xx_simple_gpiochip_probe,
.remove = mpc52xx_gpiochip_remove, .remove = mpc52xx_gpiochip_remove,
}; };

View file

@ -734,8 +734,8 @@ static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
spin_lock_init(&gpt->lock); spin_lock_init(&gpt->lock);
gpt->dev = &ofdev->dev; gpt->dev = &ofdev->dev;
gpt->ipb_freq = mpc5xxx_get_bus_frequency(ofdev->node); gpt->ipb_freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
gpt->regs = of_iomap(ofdev->node, 0); gpt->regs = of_iomap(ofdev->dev.of_node, 0);
if (!gpt->regs) { if (!gpt->regs) {
kfree(gpt); kfree(gpt);
return -ENOMEM; return -ENOMEM;
@ -743,21 +743,21 @@ static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
dev_set_drvdata(&ofdev->dev, gpt); dev_set_drvdata(&ofdev->dev, gpt);
mpc52xx_gpt_gpio_setup(gpt, ofdev->node); mpc52xx_gpt_gpio_setup(gpt, ofdev->dev.of_node);
mpc52xx_gpt_irq_setup(gpt, ofdev->node); mpc52xx_gpt_irq_setup(gpt, ofdev->dev.of_node);
mutex_lock(&mpc52xx_gpt_list_mutex); mutex_lock(&mpc52xx_gpt_list_mutex);
list_add(&gpt->list, &mpc52xx_gpt_list); list_add(&gpt->list, &mpc52xx_gpt_list);
mutex_unlock(&mpc52xx_gpt_list_mutex); mutex_unlock(&mpc52xx_gpt_list_mutex);
/* check if this device could be a watchdog */ /* check if this device could be a watchdog */
if (of_get_property(ofdev->node, "fsl,has-wdt", NULL) || if (of_get_property(ofdev->dev.of_node, "fsl,has-wdt", NULL) ||
of_get_property(ofdev->node, "has-wdt", NULL)) { of_get_property(ofdev->dev.of_node, "has-wdt", NULL)) {
const u32 *on_boot_wdt; const u32 *on_boot_wdt;
gpt->wdt_mode = MPC52xx_GPT_CAN_WDT; gpt->wdt_mode = MPC52xx_GPT_CAN_WDT;
on_boot_wdt = of_get_property(ofdev->node, "fsl,wdt-on-boot", on_boot_wdt = of_get_property(ofdev->dev.of_node,
NULL); "fsl,wdt-on-boot", NULL);
if (on_boot_wdt) { if (on_boot_wdt) {
dev_info(gpt->dev, "used as watchdog\n"); dev_info(gpt->dev, "used as watchdog\n");
gpt->wdt_mode |= MPC52xx_GPT_IS_WDT; gpt->wdt_mode |= MPC52xx_GPT_IS_WDT;
@ -784,8 +784,11 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
}; };
static struct of_platform_driver mpc52xx_gpt_driver = { static struct of_platform_driver mpc52xx_gpt_driver = {
.name = "mpc52xx-gpt", .driver = {
.match_table = mpc52xx_gpt_match, .name = "mpc52xx-gpt",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_gpt_match,
},
.probe = mpc52xx_gpt_probe, .probe = mpc52xx_gpt_probe,
.remove = mpc52xx_gpt_remove, .remove = mpc52xx_gpt_remove,
}; };

View file

@ -445,14 +445,14 @@ mpc52xx_lpbfifo_probe(struct of_device *op, const struct of_device_id *match)
if (lpbfifo.dev != NULL) if (lpbfifo.dev != NULL)
return -ENOSPC; return -ENOSPC;
lpbfifo.irq = irq_of_parse_and_map(op->node, 0); lpbfifo.irq = irq_of_parse_and_map(op->dev.of_node, 0);
if (!lpbfifo.irq) if (!lpbfifo.irq)
return -ENODEV; return -ENODEV;
if (of_address_to_resource(op->node, 0, &res)) if (of_address_to_resource(op->dev.of_node, 0, &res))
return -ENODEV; return -ENODEV;
lpbfifo.regs_phys = res.start; lpbfifo.regs_phys = res.start;
lpbfifo.regs = of_iomap(op->node, 0); lpbfifo.regs = of_iomap(op->dev.of_node, 0);
if (!lpbfifo.regs) if (!lpbfifo.regs)
return -ENOMEM; return -ENOMEM;
@ -537,9 +537,11 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = {
}; };
static struct of_platform_driver mpc52xx_lpbfifo_driver = { static struct of_platform_driver mpc52xx_lpbfifo_driver = {
.owner = THIS_MODULE, .driver = {
.name = "mpc52xx-lpbfifo", .name = "mpc52xx-lpbfifo",
.match_table = mpc52xx_lpbfifo_match, .owner = THIS_MODULE,
.of_match_table = mpc52xx_lpbfifo_match,
},
.probe = mpc52xx_lpbfifo_probe, .probe = mpc52xx_lpbfifo_probe,
.remove = __devexit_p(mpc52xx_lpbfifo_remove), .remove = __devexit_p(mpc52xx_lpbfifo_remove),
}; };

View file

@ -119,12 +119,12 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
struct device_node *node; struct device_node *node;
int ret; int ret;
node = of_get_parent(ofdev->node); node = of_get_parent(ofdev->dev.of_node);
of_node_put(node); of_node_put(node);
if (node != ep8248e_bcsr_node) if (node != ep8248e_bcsr_node)
return -ENODEV; return -ENODEV;
ret = of_address_to_resource(ofdev->node, 0, &res); ret = of_address_to_resource(ofdev->dev.of_node, 0, &res);
if (ret) if (ret)
return ret; return ret;
@ -142,7 +142,7 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
bus->parent = &ofdev->dev; bus->parent = &ofdev->dev;
snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
ret = of_mdiobus_register(bus, ofdev->node); ret = of_mdiobus_register(bus, ofdev->dev.of_node);
if (ret) if (ret)
goto err_free_irq; goto err_free_irq;
@ -170,8 +170,9 @@ static const struct of_device_id ep8248e_mdio_match[] = {
static struct of_platform_driver ep8248e_mdio_driver = { static struct of_platform_driver ep8248e_mdio_driver = {
.driver = { .driver = {
.name = "ep8248e-mdio-bitbang", .name = "ep8248e-mdio-bitbang",
.owner = THIS_MODULE,
.of_match_table = ep8248e_mdio_match,
}, },
.match_table = ep8248e_mdio_match,
.probe = ep8248e_mdio_probe, .probe = ep8248e_mdio_probe,
.remove = ep8248e_mdio_remove, .remove = ep8248e_mdio_remove,
}; };

View file

@ -321,7 +321,7 @@ static struct platform_suspend_ops mpc83xx_suspend_ops = {
static int pmc_probe(struct of_device *ofdev, static int pmc_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
struct resource res; struct resource res;
struct pmc_type *type = match->data; struct pmc_type *type = match->data;
int ret = 0; int ret = 0;
@ -423,8 +423,11 @@ static struct of_device_id pmc_match[] = {
}; };
static struct of_platform_driver pmc_driver = { static struct of_platform_driver pmc_driver = {
.name = "mpc83xx-pmc", .driver = {
.match_table = pmc_match, .name = "mpc83xx-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_match,
},
.probe = pmc_probe, .probe = pmc_probe,
.remove = pmc_remove .remove = pmc_remove
}; };

View file

@ -345,7 +345,7 @@ static int axon_msi_shutdown(struct of_device *device)
static int axon_msi_probe(struct of_device *device, static int axon_msi_probe(struct of_device *device,
const struct of_device_id *device_id) const struct of_device_id *device_id)
{ {
struct device_node *dn = device->node; struct device_node *dn = device->dev.of_node;
struct axon_msic *msic; struct axon_msic *msic;
unsigned int virq; unsigned int virq;
int dcr_base, dcr_len; int dcr_base, dcr_len;
@ -447,11 +447,12 @@ static const struct of_device_id axon_msi_device_id[] = {
}; };
static struct of_platform_driver axon_msi_driver = { static struct of_platform_driver axon_msi_driver = {
.match_table = axon_msi_device_id,
.probe = axon_msi_probe, .probe = axon_msi_probe,
.shutdown = axon_msi_shutdown, .shutdown = axon_msi_shutdown,
.driver = { .driver = {
.name = "axon-msi" .name = "axon-msi",
.owner = THIS_MODULE,
.of_match_table = axon_msi_device_id,
}, },
}; };

View file

@ -545,7 +545,6 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
{ {
struct iommu_window *window; struct iommu_window *window;
struct cbe_iommu *iommu; struct cbe_iommu *iommu;
struct dev_archdata *archdata = &dev->archdata;
/* Current implementation uses the first window available in that /* Current implementation uses the first window available in that
* node's iommu. We -might- do something smarter later though it may * node's iommu. We -might- do something smarter later though it may
@ -554,7 +553,7 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
iommu = cell_iommu_for_node(dev_to_node(dev)); iommu = cell_iommu_for_node(dev_to_node(dev));
if (iommu == NULL || list_empty(&iommu->windows)) { if (iommu == NULL || list_empty(&iommu->windows)) {
printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
archdata->of_node ? archdata->of_node->full_name : "?", dev->of_node ? dev->of_node->full_name : "?",
dev_to_node(dev)); dev_to_node(dev));
return NULL; return NULL;
} }
@ -897,7 +896,7 @@ static u64 cell_iommu_get_fixed_address(struct device *dev)
const u32 *ranges = NULL; const u32 *ranges = NULL;
int i, len, best, naddr, nsize, pna, range_size; int i, len, best, naddr, nsize, pna, range_size;
np = of_node_get(dev->archdata.of_node); np = of_node_get(dev->of_node);
while (1) { while (1) {
naddr = of_n_addr_cells(np); naddr = of_n_addr_cells(np);
nsize = of_n_size_cells(np); nsize = of_n_size_cells(np);

View file

@ -220,7 +220,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
struct mii_bus *new_bus; struct mii_bus *new_bus;
struct gpio_priv *priv; struct gpio_priv *priv;
const unsigned int *prop; const unsigned int *prop;
@ -301,11 +301,12 @@ MODULE_DEVICE_TABLE(of, gpio_mdio_match);
static struct of_platform_driver gpio_mdio_driver = static struct of_platform_driver gpio_mdio_driver =
{ {
.match_table = gpio_mdio_match,
.probe = gpio_mdio_probe, .probe = gpio_mdio_probe,
.remove = gpio_mdio_remove, .remove = gpio_mdio_remove,
.driver = { .driver = {
.name = "gpio-mdio-bitbang", .name = "gpio-mdio-bitbang",
.owner = THIS_MODULE,
.of_match_table = gpio_mdio_match,
}, },
}; };

View file

@ -360,10 +360,10 @@ static int pcmcia_notify(struct notifier_block *nb, unsigned long action,
/* We know electra_cf devices will always have of_node set, since /* We know electra_cf devices will always have of_node set, since
* electra_cf is an of_platform driver. * electra_cf is an of_platform driver.
*/ */
if (!parent->archdata.of_node) if (!parent->of_node)
return 0; return 0;
if (!of_device_is_compatible(parent->archdata.of_node, "electra-cf")) if (!of_device_is_compatible(parent->of_node, "electra-cf"))
return 0; return 0;
/* We use the direct ops for localbus */ /* We use the direct ops for localbus */

View file

@ -766,7 +766,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
BUG(); BUG();
}; };
dev->core.archdata.of_node = NULL; dev->core.of_node = NULL;
set_dev_node(&dev->core, 0); set_dev_node(&dev->core, 0);
pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core)); pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core));

View file

@ -468,7 +468,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev)); pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev));
dn = dev->dev.archdata.of_node; dn = dev->dev.of_node;
/* If we're the direct child of a root bus, then we need to allocate /* If we're the direct child of a root bus, then we need to allocate
* an iommu table ourselves. The bus setup code should have setup * an iommu table ourselves. The bus setup code should have setup

View file

@ -185,7 +185,7 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
axon_ram_bank_id++; axon_ram_bank_id++;
dev_info(&device->dev, "Found memory controller on %s\n", dev_info(&device->dev, "Found memory controller on %s\n",
device->node->full_name); device->dev.of_node->full_name);
bank = kzalloc(sizeof(struct axon_ram_bank), GFP_KERNEL); bank = kzalloc(sizeof(struct axon_ram_bank), GFP_KERNEL);
if (bank == NULL) { if (bank == NULL) {
@ -198,7 +198,7 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
bank->device = device; bank->device = device;
if (of_address_to_resource(device->node, 0, &resource) != 0) { if (of_address_to_resource(device->dev.of_node, 0, &resource) != 0) {
dev_err(&device->dev, "Cannot access device tree\n"); dev_err(&device->dev, "Cannot access device tree\n");
rc = -EFAULT; rc = -EFAULT;
goto failed; goto failed;
@ -253,7 +253,7 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
add_disk(bank->disk); add_disk(bank->disk);
bank->irq_id = irq_of_parse_and_map(device->node, 0); bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0);
if (bank->irq_id == NO_IRQ) { if (bank->irq_id == NO_IRQ) {
dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
rc = -EFAULT; rc = -EFAULT;
@ -327,12 +327,12 @@ static struct of_device_id axon_ram_device_id[] = {
}; };
static struct of_platform_driver axon_ram_driver = { static struct of_platform_driver axon_ram_driver = {
.match_table = axon_ram_device_id,
.probe = axon_ram_probe, .probe = axon_ram_probe,
.remove = axon_ram_remove, .remove = axon_ram_remove,
.driver = { .driver = {
.owner = THIS_MODULE, .name = AXON_RAM_MODULE_NAME,
.name = AXON_RAM_MODULE_NAME, .owner = THIS_MODULE,
.of_match_table = axon_ram_device_id,
}, },
}; };

View file

@ -377,7 +377,7 @@ mpc52xx_bcom_probe(struct of_device *op, const struct of_device_id *match)
printk(KERN_INFO "DMA: MPC52xx BestComm driver\n"); printk(KERN_INFO "DMA: MPC52xx BestComm driver\n");
/* Get the bestcomm node */ /* Get the bestcomm node */
of_node_get(op->node); of_node_get(op->dev.of_node);
/* Prepare SRAM */ /* Prepare SRAM */
ofn_sram = of_find_matching_node(NULL, mpc52xx_sram_ids); ofn_sram = of_find_matching_node(NULL, mpc52xx_sram_ids);
@ -406,10 +406,10 @@ mpc52xx_bcom_probe(struct of_device *op, const struct of_device_id *match)
} }
/* Save the node */ /* Save the node */
bcom_eng->ofnode = op->node; bcom_eng->ofnode = op->dev.of_node;
/* Get, reserve & map io */ /* Get, reserve & map io */
if (of_address_to_resource(op->node, 0, &res_bcom)) { if (of_address_to_resource(op->dev.of_node, 0, &res_bcom)) {
printk(KERN_ERR DRIVER_NAME ": " printk(KERN_ERR DRIVER_NAME ": "
"Can't get resource\n"); "Can't get resource\n");
rv = -EINVAL; rv = -EINVAL;
@ -453,7 +453,7 @@ error_sramclean:
kfree(bcom_eng); kfree(bcom_eng);
bcom_sram_cleanup(); bcom_sram_cleanup();
error_ofput: error_ofput:
of_node_put(op->node); of_node_put(op->dev.of_node);
printk(KERN_ERR "DMA: MPC52xx BestComm init failed !\n"); printk(KERN_ERR "DMA: MPC52xx BestComm init failed !\n");
@ -494,14 +494,12 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
static struct of_platform_driver mpc52xx_bcom_of_platform_driver = { static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.match_table = mpc52xx_bcom_of_match,
.probe = mpc52xx_bcom_probe, .probe = mpc52xx_bcom_probe,
.remove = mpc52xx_bcom_remove, .remove = mpc52xx_bcom_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = mpc52xx_bcom_of_match,
}, },
}; };

View file

@ -249,7 +249,7 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
goto error_out; goto error_out;
} }
msi->irqhost = irq_alloc_host(dev->node, IRQ_HOST_MAP_LINEAR, msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR,
NR_MSI_IRQS, &fsl_msi_host_ops, 0); NR_MSI_IRQS, &fsl_msi_host_ops, 0);
if (msi->irqhost == NULL) { if (msi->irqhost == NULL) {
@ -259,10 +259,10 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
} }
/* Get the MSI reg base */ /* Get the MSI reg base */
err = of_address_to_resource(dev->node, 0, &res); err = of_address_to_resource(dev->dev.of_node, 0, &res);
if (err) { if (err) {
dev_err(&dev->dev, "%s resource error!\n", dev_err(&dev->dev, "%s resource error!\n",
dev->node->full_name); dev->dev.of_node->full_name);
goto error_out; goto error_out;
} }
@ -285,16 +285,16 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
goto error_out; goto error_out;
} }
p = of_get_property(dev->node, "interrupts", &count); p = of_get_property(dev->dev.of_node, "interrupts", &count);
if (!p) { if (!p) {
dev_err(&dev->dev, "no interrupts property found on %s\n", dev_err(&dev->dev, "no interrupts property found on %s\n",
dev->node->full_name); dev->dev.of_node->full_name);
err = -ENODEV; err = -ENODEV;
goto error_out; goto error_out;
} }
if (count % 8 != 0) { if (count % 8 != 0) {
dev_err(&dev->dev, "Malformed interrupts property on %s\n", dev_err(&dev->dev, "Malformed interrupts property on %s\n",
dev->node->full_name); dev->dev.of_node->full_name);
err = -EINVAL; err = -EINVAL;
goto error_out; goto error_out;
} }
@ -303,7 +303,7 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
for (i = 0; i < count / 2; i++) { for (i = 0; i < count / 2; i++) {
if (i > NR_MSI_REG) if (i > NR_MSI_REG)
break; break;
virt_msir = irq_of_parse_and_map(dev->node, i); virt_msir = irq_of_parse_and_map(dev->dev.of_node, i);
if (virt_msir != NO_IRQ) { if (virt_msir != NO_IRQ) {
set_irq_data(virt_msir, (void *)i); set_irq_data(virt_msir, (void *)i);
set_irq_chained_handler(virt_msir, fsl_msi_cascade); set_irq_chained_handler(virt_msir, fsl_msi_cascade);
@ -345,8 +345,11 @@ static const struct of_device_id fsl_of_msi_ids[] = {
}; };
static struct of_platform_driver fsl_of_msi_driver = { static struct of_platform_driver fsl_of_msi_driver = {
.name = "fsl-msi", .driver = {
.match_table = fsl_of_msi_ids, .name = "fsl-msi",
.owner = THIS_MODULE,
.of_match_table = fsl_of_msi_ids,
},
.probe = fsl_of_msi_probe, .probe = fsl_of_msi_probe,
}; };

View file

@ -60,7 +60,7 @@ static struct platform_suspend_ops pmc_suspend_ops = {
static int pmc_probe(struct of_device *ofdev, const struct of_device_id *id) static int pmc_probe(struct of_device *ofdev, const struct of_device_id *id)
{ {
pmc_regs = of_iomap(ofdev->node, 0); pmc_regs = of_iomap(ofdev->dev.of_node, 0);
if (!pmc_regs) if (!pmc_regs)
return -ENOMEM; return -ENOMEM;
@ -76,8 +76,11 @@ static const struct of_device_id pmc_ids[] = {
}; };
static struct of_platform_driver pmc_driver = { static struct of_platform_driver pmc_driver = {
.driver.name = "fsl-pmc", .driver = {
.match_table = pmc_ids, .name = "fsl-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_ids,
},
.probe = pmc_probe, .probe = pmc_probe,
}; };

View file

@ -1015,41 +1015,41 @@ int fsl_rio_setup(struct of_device *dev)
u64 law_start, law_size; u64 law_start, law_size;
int paw, aw, sw; int paw, aw, sw;
if (!dev->node) { if (!dev->dev.of_node) {
dev_err(&dev->dev, "Device OF-Node is NULL"); dev_err(&dev->dev, "Device OF-Node is NULL");
return -EFAULT; return -EFAULT;
} }
rc = of_address_to_resource(dev->node, 0, &regs); rc = of_address_to_resource(dev->dev.of_node, 0, &regs);
if (rc) { if (rc) {
dev_err(&dev->dev, "Can't get %s property 'reg'\n", dev_err(&dev->dev, "Can't get %s property 'reg'\n",
dev->node->full_name); dev->dev.of_node->full_name);
return -EFAULT; return -EFAULT;
} }
dev_info(&dev->dev, "Of-device full name %s\n", dev->node->full_name); dev_info(&dev->dev, "Of-device full name %s\n", dev->dev.of_node->full_name);
dev_info(&dev->dev, "Regs: %pR\n", &regs); dev_info(&dev->dev, "Regs: %pR\n", &regs);
dt_range = of_get_property(dev->node, "ranges", &rlen); dt_range = of_get_property(dev->dev.of_node, "ranges", &rlen);
if (!dt_range) { if (!dt_range) {
dev_err(&dev->dev, "Can't get %s property 'ranges'\n", dev_err(&dev->dev, "Can't get %s property 'ranges'\n",
dev->node->full_name); dev->dev.of_node->full_name);
return -EFAULT; return -EFAULT;
} }
/* Get node address wide */ /* Get node address wide */
cell = of_get_property(dev->node, "#address-cells", NULL); cell = of_get_property(dev->dev.of_node, "#address-cells", NULL);
if (cell) if (cell)
aw = *cell; aw = *cell;
else else
aw = of_n_addr_cells(dev->node); aw = of_n_addr_cells(dev->dev.of_node);
/* Get node size wide */ /* Get node size wide */
cell = of_get_property(dev->node, "#size-cells", NULL); cell = of_get_property(dev->dev.of_node, "#size-cells", NULL);
if (cell) if (cell)
sw = *cell; sw = *cell;
else else
sw = of_n_size_cells(dev->node); sw = of_n_size_cells(dev->dev.of_node);
/* Get parent address wide wide */ /* Get parent address wide wide */
paw = of_n_addr_cells(dev->node); paw = of_n_addr_cells(dev->dev.of_node);
law_start = of_read_number(dt_range + aw, paw); law_start = of_read_number(dt_range + aw, paw);
law_size = of_read_number(dt_range + aw + paw, sw); law_size = of_read_number(dt_range + aw + paw, sw);
@ -1089,9 +1089,9 @@ int fsl_rio_setup(struct of_device *dev)
port->iores.flags = IORESOURCE_MEM; port->iores.flags = IORESOURCE_MEM;
port->iores.name = "rio_io_win"; port->iores.name = "rio_io_win";
priv->bellirq = irq_of_parse_and_map(dev->node, 2); priv->bellirq = irq_of_parse_and_map(dev->dev.of_node, 2);
priv->txirq = irq_of_parse_and_map(dev->node, 3); priv->txirq = irq_of_parse_and_map(dev->dev.of_node, 3);
priv->rxirq = irq_of_parse_and_map(dev->node, 4); priv->rxirq = irq_of_parse_and_map(dev->dev.of_node, 4);
dev_info(&dev->dev, "bellirq: %d, txirq: %d, rxirq %d\n", priv->bellirq, dev_info(&dev->dev, "bellirq: %d, txirq: %d, rxirq %d\n", priv->bellirq,
priv->txirq, priv->rxirq); priv->txirq, priv->rxirq);
@ -1195,7 +1195,7 @@ static int __devinit fsl_of_rio_rpn_probe(struct of_device *dev,
{ {
int rc; int rc;
printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n", printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
dev->node->full_name); dev->dev.of_node->full_name);
rc = fsl_rio_setup(dev); rc = fsl_rio_setup(dev);
if (rc) if (rc)
@ -1215,8 +1215,11 @@ static const struct of_device_id fsl_of_rio_rpn_ids[] = {
}; };
static struct of_platform_driver fsl_of_rio_rpn_driver = { static struct of_platform_driver fsl_of_rio_rpn_driver = {
.name = "fsl-of-rio", .driver = {
.match_table = fsl_of_rio_rpn_ids, .name = "fsl-of-rio",
.owner = THIS_MODULE,
.of_match_table = fsl_of_rio_rpn_ids,
},
.probe = fsl_of_rio_rpn_probe, .probe = fsl_of_rio_rpn_probe,
}; };

View file

@ -124,7 +124,7 @@ static void pmi_notify_handlers(struct work_struct *work)
static int pmi_of_probe(struct of_device *dev, static int pmi_of_probe(struct of_device *dev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *np = dev->node; struct device_node *np = dev->dev.of_node;
int rc; int rc;
if (data) { if (data) {
@ -206,11 +206,12 @@ static int pmi_of_remove(struct of_device *dev)
} }
static struct of_platform_driver pmi_of_platform_driver = { static struct of_platform_driver pmi_of_platform_driver = {
.match_table = pmi_match,
.probe = pmi_of_probe, .probe = pmi_of_probe,
.remove = pmi_of_remove, .remove = pmi_of_remove,
.driver = { .driver = {
.name = "pmi", .name = "pmi",
.owner = THIS_MODULE,
.of_match_table = pmi_match,
}, },
}; };

View file

@ -669,8 +669,11 @@ static const struct of_device_id qe_ids[] = {
}; };
static struct of_platform_driver qe_driver = { static struct of_platform_driver qe_driver = {
.driver.name = "fsl-qe", .driver = {
.match_table = qe_ids, .name = "fsl-qe",
.owner = THIS_MODULE,
.of_match_table = qe_ids,
},
.probe = qe_probe, .probe = qe_probe,
.resume = qe_resume, .resume = qe_resume,
}; };

View file

@ -13,25 +13,10 @@ struct dev_archdata {
void *iommu; void *iommu;
void *stc; void *stc;
void *host_controller; void *host_controller;
struct device_node *prom_node;
struct of_device *op; struct of_device *op;
int numa_node; int numa_node;
}; };
static inline void dev_archdata_set_node(struct dev_archdata *ad,
struct device_node *np)
{
ad->prom_node = np;
}
static inline struct device_node *
dev_archdata_get_node(const struct dev_archdata *ad)
{
return ad->prom_node;
}
struct pdev_archdata { struct pdev_archdata {
}; };

View file

@ -18,7 +18,7 @@ static inline int fb_is_primary_device(struct fb_info *info)
struct device *dev = info->device; struct device *dev = info->device;
struct device_node *node; struct device_node *node;
node = dev->archdata.prom_node; node = dev->of_node;
if (node && if (node &&
node == of_console_device) node == of_console_device)
return 1; return 1;

View file

@ -589,7 +589,7 @@ static unsigned long __init sun_floppy_init(void)
if (!op) if (!op)
return 0; return 0;
state_prop = of_get_property(op->node, "status", NULL); state_prop = of_get_property(op->dev.of_node, "status", NULL);
if (state_prop && !strncmp(state_prop, "disabled", 8)) if (state_prop && !strncmp(state_prop, "disabled", 8))
return 0; return 0;
@ -716,7 +716,7 @@ static unsigned long __init sun_floppy_init(void)
return sun_floppy_types[0]; return sun_floppy_types[0];
} }
prop = of_get_property(op->node, "status", NULL); prop = of_get_property(op->dev.of_node, "status", NULL);
if (prop && !strncmp(state, "disabled", 8)) if (prop && !strncmp(state, "disabled", 8))
return 0; return 0;

View file

@ -14,7 +14,6 @@
*/ */
struct of_device struct of_device
{ {
struct device_node *node;
struct device dev; struct device dev;
struct resource resource[PROMREG_MAX]; struct resource resource[PROMREG_MAX];
unsigned int irqs[PROMINTR_MAX]; unsigned int irqs[PROMINTR_MAX];

View file

@ -113,7 +113,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
struct parport *p; struct parport *p;
int slot, err; int slot, err;
parent = op->node->parent; parent = op->dev.of_node->parent;
if (!strcmp(parent->name, "dma")) { if (!strcmp(parent->name, "dma")) {
p = parport_pc_probe_port(base, base + 0x400, p = parport_pc_probe_port(base, base + 0x400,
op->irqs[0], PARPORT_DMA_NOFIFO, op->irqs[0], PARPORT_DMA_NOFIFO,
@ -232,8 +232,11 @@ static const struct of_device_id ecpp_match[] = {
}; };
static struct of_platform_driver ecpp_driver = { static struct of_platform_driver ecpp_driver = {
.name = "ecpp", .driver = {
.match_table = ecpp_match, .name = "ecpp",
.owner = THIS_MODULE,
.of_match_table = ecpp_match,
},
.probe = ecpp_probe, .probe = ecpp_probe,
.remove = __devexit_p(ecpp_remove), .remove = __devexit_p(ecpp_remove),
}; };

View file

@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = {
MODULE_DEVICE_TABLE(of, apc_match); MODULE_DEVICE_TABLE(of, apc_match);
static struct of_platform_driver apc_driver = { static struct of_platform_driver apc_driver = {
.name = "apc", .driver = {
.match_table = apc_match, .name = "apc",
.owner = THIS_MODULE,
.of_match_table = apc_match,
},
.probe = apc_probe, .probe = apc_probe,
}; };

View file

@ -104,7 +104,7 @@ MODULE_DEVICE_TABLE(of, auxio_match);
static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match)
{ {
struct device_node *dp = dev->node; struct device_node *dp = dev->dev.of_node;
unsigned long size; unsigned long size;
if (!strcmp(dp->parent->name, "ebus")) { if (!strcmp(dp->parent->name, "ebus")) {
@ -132,10 +132,11 @@ static int __devinit auxio_probe(struct of_device *dev, const struct of_device_i
} }
static struct of_platform_driver auxio_driver = { static struct of_platform_driver auxio_driver = {
.match_table = auxio_match,
.probe = auxio_probe, .probe = auxio_probe,
.driver = { .driver = {
.name = "auxio", .name = "auxio",
.owner = THIS_MODULE,
.of_match_table = auxio_match,
}, },
}; };

View file

@ -149,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = {
}; };
static struct of_platform_driver clock_board_driver = { static struct of_platform_driver clock_board_driver = {
.match_table = clock_board_match,
.probe = clock_board_probe, .probe = clock_board_probe,
.driver = { .driver = {
.name = "clock_board", .name = "clock_board",
.owner = THIS_MODULE,
.of_match_table = clock_board_match,
}, },
}; };
@ -168,7 +169,7 @@ static int __devinit fhc_probe(struct of_device *op,
goto out; goto out;
} }
if (!strcmp(op->node->parent->name, "central")) if (!strcmp(op->dev.of_node->parent->name, "central"))
p->central = true; p->central = true;
p->pregs = of_ioremap(&op->resource[0], 0, p->pregs = of_ioremap(&op->resource[0], 0,
@ -183,7 +184,7 @@ static int __devinit fhc_probe(struct of_device *op,
reg = upa_readl(p->pregs + FHC_PREGS_BSR); reg = upa_readl(p->pregs + FHC_PREGS_BSR);
p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e); p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e);
} else { } else {
p->board_num = of_getintprop_default(op->node, "board#", -1); p->board_num = of_getintprop_default(op->dev.of_node, "board#", -1);
if (p->board_num == -1) { if (p->board_num == -1) {
printk(KERN_ERR "fhc: No board# property\n"); printk(KERN_ERR "fhc: No board# property\n");
goto out_unmap_pregs; goto out_unmap_pregs;
@ -254,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = {
}; };
static struct of_platform_driver fhc_driver = { static struct of_platform_driver fhc_driver = {
.match_table = fhc_match,
.probe = fhc_probe, .probe = fhc_probe,
.driver = { .driver = {
.name = "fhc", .name = "fhc",
.owner = THIS_MODULE,
.of_match_table = fhc_match,
}, },
}; };

View file

@ -425,7 +425,7 @@ static int __devinit jbusmc_probe(struct of_device *op,
INIT_LIST_HEAD(&p->list); INIT_LIST_HEAD(&p->list);
err = -ENODEV; err = -ENODEV;
prop = of_get_property(op->node, "portid", &len); prop = of_get_property(op->dev.of_node, "portid", &len);
if (!prop || len != 4) { if (!prop || len != 4) {
printk(KERN_ERR PFX "Cannot find portid.\n"); printk(KERN_ERR PFX "Cannot find portid.\n");
goto out_free; goto out_free;
@ -433,7 +433,7 @@ static int __devinit jbusmc_probe(struct of_device *op,
p->portid = *prop; p->portid = *prop;
prop = of_get_property(op->node, "memory-control-register-1", &len); prop = of_get_property(op->dev.of_node, "memory-control-register-1", &len);
if (!prop || len != 8) { if (!prop || len != 8) {
printk(KERN_ERR PFX "Cannot get memory control register 1.\n"); printk(KERN_ERR PFX "Cannot get memory control register 1.\n");
goto out_free; goto out_free;
@ -449,7 +449,7 @@ static int __devinit jbusmc_probe(struct of_device *op,
} }
err = -ENODEV; err = -ENODEV;
ml = of_get_property(op->node, "memory-layout", &p->layout_len); ml = of_get_property(op->dev.of_node, "memory-layout", &p->layout_len);
if (!ml) { if (!ml) {
printk(KERN_ERR PFX "Cannot get memory layout property.\n"); printk(KERN_ERR PFX "Cannot get memory layout property.\n");
goto out_iounmap; goto out_iounmap;
@ -466,7 +466,7 @@ static int __devinit jbusmc_probe(struct of_device *op,
mc_list_add(&p->list); mc_list_add(&p->list);
printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n", printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n",
op->node->full_name); op->dev.of_node->full_name);
dev_set_drvdata(&op->dev, p); dev_set_drvdata(&op->dev, p);
@ -693,7 +693,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
static int __devinit chmc_probe(struct of_device *op, static int __devinit chmc_probe(struct of_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
unsigned long ver; unsigned long ver;
const void *pval; const void *pval;
int len, portid; int len, portid;
@ -811,8 +811,11 @@ static const struct of_device_id us3mc_match[] = {
MODULE_DEVICE_TABLE(of, us3mc_match); MODULE_DEVICE_TABLE(of, us3mc_match);
static struct of_platform_driver us3mc_driver = { static struct of_platform_driver us3mc_driver = {
.name = "us3mc", .driver = {
.match_table = us3mc_match, .name = "us3mc",
.owner = THIS_MODULE,
.of_match_table = us3mc_match,
},
.probe = us3mc_probe, .probe = us3mc_probe,
.remove = __devexit_p(us3mc_remove), .remove = __devexit_p(us3mc_remove),
}; };

View file

@ -290,7 +290,7 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len,
if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0)
goto err_noiommu; goto err_noiommu;
res->name = op->node->name; res->name = op->dev.of_node->name;
return (void *)(unsigned long)res->start; return (void *)(unsigned long)res->start;

View file

@ -254,10 +254,10 @@ static void __init build_device_resources(struct of_device *op,
return; return;
p_op = to_of_device(parent); p_op = to_of_device(parent);
bus = of_match_bus(p_op->node); bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->node, &na, &ns); bus->count_cells(op->dev.of_node, &na, &ns);
preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg);
if (!preg || num_reg == 0) if (!preg || num_reg == 0)
return; return;
@ -271,8 +271,8 @@ static void __init build_device_resources(struct of_device *op,
struct resource *r = &op->resource[index]; struct resource *r = &op->resource[index];
u32 addr[OF_MAX_ADDR_CELLS]; u32 addr[OF_MAX_ADDR_CELLS];
const u32 *reg = (preg + (index * ((na + ns) * 4))); const u32 *reg = (preg + (index * ((na + ns) * 4)));
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct device_node *pp = p_op->node; struct device_node *pp = p_op->dev.of_node;
struct of_bus *pbus, *dbus; struct of_bus *pbus, *dbus;
u64 size, result = OF_BAD_ADDR; u64 size, result = OF_BAD_ADDR;
unsigned long flags; unsigned long flags;
@ -321,7 +321,7 @@ static void __init build_device_resources(struct of_device *op,
if (of_resource_verbose) if (of_resource_verbose)
printk("%s reg[%d] -> %llx\n", printk("%s reg[%d] -> %llx\n",
op->node->full_name, index, op->dev.of_node->full_name, index,
result); result);
if (result != OF_BAD_ADDR) { if (result != OF_BAD_ADDR) {
@ -329,7 +329,7 @@ static void __init build_device_resources(struct of_device *op,
r->end = result + size - 1; r->end = result + size - 1;
r->flags = flags | ((result >> 32ULL) & 0xffUL); r->flags = flags | ((result >> 32ULL) & 0xffUL);
} }
r->name = op->node->name; r->name = op->dev.of_node->name;
} }
} }
@ -345,10 +345,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
return NULL; return NULL;
sd = &op->dev.archdata; sd = &op->dev.archdata;
sd->prom_node = dp;
sd->op = op; sd->op = op;
op->node = dp; op->dev.of_node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency", op->clock_freq = of_getintprop_default(dp, "clock-frequency",
(25*1000*1000)); (25*1000*1000));

View file

@ -323,10 +323,10 @@ static void __init build_device_resources(struct of_device *op,
return; return;
p_op = to_of_device(parent); p_op = to_of_device(parent);
bus = of_match_bus(p_op->node); bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->node, &na, &ns); bus->count_cells(op->dev.of_node, &na, &ns);
preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg);
if (!preg || num_reg == 0) if (!preg || num_reg == 0)
return; return;
@ -340,7 +340,7 @@ static void __init build_device_resources(struct of_device *op,
if (num_reg > PROMREG_MAX) { if (num_reg > PROMREG_MAX) {
printk(KERN_WARNING "%s: Too many regs (%d), " printk(KERN_WARNING "%s: Too many regs (%d), "
"limiting to %d.\n", "limiting to %d.\n",
op->node->full_name, num_reg, PROMREG_MAX); op->dev.of_node->full_name, num_reg, PROMREG_MAX);
num_reg = PROMREG_MAX; num_reg = PROMREG_MAX;
} }
@ -348,8 +348,8 @@ static void __init build_device_resources(struct of_device *op,
struct resource *r = &op->resource[index]; struct resource *r = &op->resource[index];
u32 addr[OF_MAX_ADDR_CELLS]; u32 addr[OF_MAX_ADDR_CELLS];
const u32 *reg = (preg + (index * ((na + ns) * 4))); const u32 *reg = (preg + (index * ((na + ns) * 4)));
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct device_node *pp = p_op->node; struct device_node *pp = p_op->dev.of_node;
struct of_bus *pbus, *dbus; struct of_bus *pbus, *dbus;
u64 size, result = OF_BAD_ADDR; u64 size, result = OF_BAD_ADDR;
unsigned long flags; unsigned long flags;
@ -397,7 +397,7 @@ static void __init build_device_resources(struct of_device *op,
if (of_resource_verbose) if (of_resource_verbose)
printk("%s reg[%d] -> %llx\n", printk("%s reg[%d] -> %llx\n",
op->node->full_name, index, op->dev.of_node->full_name, index,
result); result);
if (result != OF_BAD_ADDR) { if (result != OF_BAD_ADDR) {
@ -408,7 +408,7 @@ static void __init build_device_resources(struct of_device *op,
r->end = result + size - 1; r->end = result + size - 1;
r->flags = flags; r->flags = flags;
} }
r->name = op->node->name; r->name = op->dev.of_node->name;
} }
} }
@ -530,7 +530,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
struct device *parent, struct device *parent,
unsigned int irq) unsigned int irq)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct device_node *pp, *ip; struct device_node *pp, *ip;
unsigned int orig_irq = irq; unsigned int orig_irq = irq;
int nid; int nid;
@ -575,7 +575,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
if (of_irq_verbose) if (of_irq_verbose)
printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
op->node->full_name, op->dev.of_node->full_name,
pp->full_name, this_orig_irq, pp->full_name, this_orig_irq,
(iret ? iret->full_name : "NULL"), irq); (iret ? iret->full_name : "NULL"), irq);
@ -594,7 +594,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
if (of_irq_verbose) if (of_irq_verbose)
printk("%s: PCI swizzle [%s] " printk("%s: PCI swizzle [%s] "
"%x --> %x\n", "%x --> %x\n",
op->node->full_name, op->dev.of_node->full_name,
pp->full_name, this_orig_irq, pp->full_name, this_orig_irq,
irq); irq);
@ -611,11 +611,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
if (!ip) if (!ip)
return orig_irq; return orig_irq;
irq = ip->irq_trans->irq_build(op->node, irq, irq = ip->irq_trans->irq_build(op->dev.of_node, irq,
ip->irq_trans->data); ip->irq_trans->data);
if (of_irq_verbose) if (of_irq_verbose)
printk("%s: Apply IRQ trans [%s] %x --> %x\n", printk("%s: Apply IRQ trans [%s] %x --> %x\n",
op->node->full_name, ip->full_name, orig_irq, irq); op->dev.of_node->full_name, ip->full_name, orig_irq, irq);
out: out:
nid = of_node_to_nid(dp); nid = of_node_to_nid(dp);
@ -640,10 +640,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
return NULL; return NULL;
sd = &op->dev.archdata; sd = &op->dev.archdata;
sd->prom_node = dp;
sd->op = op; sd->op = op;
op->node = dp; op->dev.of_node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency", op->clock_freq = of_getintprop_default(dp, "clock-frequency",
(25*1000*1000)); (25*1000*1000));

View file

@ -16,7 +16,7 @@ static int node_match(struct device *dev, void *data)
struct of_device *op = to_of_device(dev); struct of_device *op = to_of_device(dev);
struct device_node *dp = data; struct device_node *dp = data;
return (op->node == dp); return (op->dev.of_node == dp);
} }
struct of_device *of_find_device_by_node(struct device_node *dp) struct of_device *of_find_device_by_node(struct device_node *dp)
@ -48,7 +48,7 @@ EXPORT_SYMBOL(irq_of_parse_and_map);
void of_propagate_archdata(struct of_device *bus) void of_propagate_archdata(struct of_device *bus)
{ {
struct dev_archdata *bus_sd = &bus->dev.archdata; struct dev_archdata *bus_sd = &bus->dev.archdata;
struct device_node *bus_dp = bus->node; struct device_node *bus_dp = bus->dev.of_node;
struct device_node *dp; struct device_node *dp;
for (dp = bus_dp->child; dp; dp = dp->sibling) { for (dp = bus_dp->child; dp; dp = dp->sibling) {

View file

@ -261,7 +261,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
sd->iommu = pbm->iommu; sd->iommu = pbm->iommu;
sd->stc = &pbm->stc; sd->stc = &pbm->stc;
sd->host_controller = pbm; sd->host_controller = pbm;
sd->prom_node = node;
sd->op = op = of_find_device_by_node(node); sd->op = op = of_find_device_by_node(node);
sd->numa_node = pbm->numa_node; sd->numa_node = pbm->numa_node;
@ -285,6 +284,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
dev->sysdata = node; dev->sysdata = node;
dev->dev.parent = bus->bridge; dev->dev.parent = bus->bridge;
dev->dev.bus = &pci_bus_type; dev->dev.bus = &pci_bus_type;
dev->dev.of_node = node;
dev->devfn = devfn; dev->devfn = devfn;
dev->multifunction = 0; /* maybe a lie? */ dev->multifunction = 0; /* maybe a lie? */
set_pcie_port_type(dev); set_pcie_port_type(dev);
@ -653,7 +653,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *
struct device_node *dp; struct device_node *dp;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
dp = pdev->dev.archdata.prom_node; dp = pdev->dev.of_node;
return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name); return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name);
} }
@ -683,7 +683,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)
struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
struct device *parent) struct device *parent)
{ {
struct device_node *node = pbm->op->node; struct device_node *node = pbm->op->dev.of_node;
struct pci_bus *bus; struct pci_bus *bus;
printk("PCI: Scanning PBM %s\n", node->full_name); printk("PCI: Scanning PBM %s\n", node->full_name);
@ -1022,7 +1022,7 @@ void arch_teardown_msi_irq(unsigned int virt_irq)
struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
{ {
return pdev->dev.archdata.prom_node; return pdev->dev.of_node;
} }
EXPORT_SYMBOL(pci_device_to_OF_node); EXPORT_SYMBOL(pci_device_to_OF_node);
@ -1151,15 +1151,13 @@ static int __init of_pci_slot_init(void)
struct device_node *node; struct device_node *node;
if (pbus->self) { if (pbus->self) {
struct dev_archdata *sd = pbus->self->sysdata;
/* PCI->PCI bridge */ /* PCI->PCI bridge */
node = sd->prom_node; node = pbus->self->dev.of_node;
} else { } else {
struct pci_pbm_info *pbm = pbus->sysdata; struct pci_pbm_info *pbm = pbus->sysdata;
/* Host PCI controller */ /* Host PCI controller */
node = pbm->op->node; node = pbm->op->dev.of_node;
} }
pci_bus_slot_names(node, pbus); pci_bus_slot_names(node, pbus);

View file

@ -314,12 +314,12 @@ struct pci_ops sun4v_pci_ops = {
void pci_get_pbm_props(struct pci_pbm_info *pbm) void pci_get_pbm_props(struct pci_pbm_info *pbm)
{ {
const u32 *val = of_get_property(pbm->op->node, "bus-range", NULL); const u32 *val = of_get_property(pbm->op->dev.of_node, "bus-range", NULL);
pbm->pci_first_busno = val[0]; pbm->pci_first_busno = val[0];
pbm->pci_last_busno = val[1]; pbm->pci_last_busno = val[1];
val = of_get_property(pbm->op->node, "ino-bitmap", NULL); val = of_get_property(pbm->op->dev.of_node, "ino-bitmap", NULL);
if (val) { if (val) {
pbm->ino_bitmap = (((u64)val[1] << 32UL) | pbm->ino_bitmap = (((u64)val[1] << 32UL) |
((u64)val[0] << 0UL)); ((u64)val[0] << 0UL));
@ -365,7 +365,8 @@ static void pci_register_legacy_regions(struct resource *io_res,
static void pci_register_iommu_region(struct pci_pbm_info *pbm) static void pci_register_iommu_region(struct pci_pbm_info *pbm)
{ {
const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); const u32 *vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma",
NULL);
if (vdma) { if (vdma) {
struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL);
@ -394,7 +395,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
int num_pbm_ranges; int num_pbm_ranges;
saw_mem = saw_io = 0; saw_mem = saw_io = 0;
pbm_ranges = of_get_property(pbm->op->node, "ranges", &i); pbm_ranges = of_get_property(pbm->op->dev.of_node, "ranges", &i);
if (!pbm_ranges) { if (!pbm_ranges) {
prom_printf("PCI: Fatal error, missing PBM ranges property " prom_printf("PCI: Fatal error, missing PBM ranges property "
" for %s\n", " for %s\n",

View file

@ -413,7 +413,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 portid) struct of_device *op, u32 portid)
{ {
const struct linux_prom64_registers *regs; const struct linux_prom64_registers *regs;
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
int err; int err;
pbm->numa_node = -1; pbm->numa_node = -1;
@ -458,7 +458,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
static int __devinit fire_probe(struct of_device *op, static int __devinit fire_probe(struct of_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
struct iommu *iommu; struct iommu *iommu;
u32 portid; u32 portid;
@ -508,8 +508,11 @@ static struct of_device_id __initdata fire_match[] = {
}; };
static struct of_platform_driver fire_driver = { static struct of_platform_driver fire_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = fire_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = fire_match,
},
.probe = fire_probe, .probe = fire_probe,
}; };

View file

@ -324,7 +324,7 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
const u32 *val; const u32 *val;
int len; int len;
val = of_get_property(pbm->op->node, "#msi-eqs", &len); val = of_get_property(pbm->op->dev.of_node, "#msi-eqs", &len);
if (!val || len != 4) if (!val || len != 4)
goto no_msi; goto no_msi;
pbm->msiq_num = *val; pbm->msiq_num = *val;
@ -347,16 +347,16 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
u32 msi64_len; u32 msi64_len;
} *arng; } *arng;
val = of_get_property(pbm->op->node, "msi-eq-size", &len); val = of_get_property(pbm->op->dev.of_node, "msi-eq-size", &len);
if (!val || len != 4) if (!val || len != 4)
goto no_msi; goto no_msi;
pbm->msiq_ent_count = *val; pbm->msiq_ent_count = *val;
mqp = of_get_property(pbm->op->node, mqp = of_get_property(pbm->op->dev.of_node,
"msi-eq-to-devino", &len); "msi-eq-to-devino", &len);
if (!mqp) if (!mqp)
mqp = of_get_property(pbm->op->node, mqp = of_get_property(pbm->op->dev.of_node,
"msi-eq-devino", &len); "msi-eq-devino", &len);
if (!mqp || len != sizeof(struct msiq_prop)) if (!mqp || len != sizeof(struct msiq_prop))
goto no_msi; goto no_msi;
@ -364,27 +364,27 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
pbm->msiq_first = mqp->first_msiq; pbm->msiq_first = mqp->first_msiq;
pbm->msiq_first_devino = mqp->first_devino; pbm->msiq_first_devino = mqp->first_devino;
val = of_get_property(pbm->op->node, "#msi", &len); val = of_get_property(pbm->op->dev.of_node, "#msi", &len);
if (!val || len != 4) if (!val || len != 4)
goto no_msi; goto no_msi;
pbm->msi_num = *val; pbm->msi_num = *val;
mrng = of_get_property(pbm->op->node, "msi-ranges", &len); mrng = of_get_property(pbm->op->dev.of_node, "msi-ranges", &len);
if (!mrng || len != sizeof(struct msi_range_prop)) if (!mrng || len != sizeof(struct msi_range_prop))
goto no_msi; goto no_msi;
pbm->msi_first = mrng->first_msi; pbm->msi_first = mrng->first_msi;
val = of_get_property(pbm->op->node, "msi-data-mask", &len); val = of_get_property(pbm->op->dev.of_node, "msi-data-mask", &len);
if (!val || len != 4) if (!val || len != 4)
goto no_msi; goto no_msi;
pbm->msi_data_mask = *val; pbm->msi_data_mask = *val;
val = of_get_property(pbm->op->node, "msix-data-width", &len); val = of_get_property(pbm->op->dev.of_node, "msix-data-width", &len);
if (!val || len != 4) if (!val || len != 4)
goto no_msi; goto no_msi;
pbm->msix_data_width = *val; pbm->msix_data_width = *val;
arng = of_get_property(pbm->op->node, "msi-address-ranges", arng = of_get_property(pbm->op->dev.of_node, "msi-address-ranges",
&len); &len);
if (!arng || len != sizeof(struct addr_range_prop)) if (!arng || len != sizeof(struct addr_range_prop))
goto no_msi; goto no_msi;

View file

@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
static void psycho_register_error_handlers(struct pci_pbm_info *pbm) static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->node); struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
unsigned long base = pbm->controller_regs; unsigned long base = pbm->controller_regs;
u64 tmp; u64 tmp;
int err; int err;
@ -507,7 +507,7 @@ static int __devinit psycho_probe(struct of_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *pr_regs; const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
struct iommu *iommu; struct iommu *iommu;
int is_pbm_a, err; int is_pbm_a, err;
@ -602,8 +602,11 @@ static struct of_device_id __initdata psycho_match[] = {
}; };
static struct of_platform_driver psycho_driver = { static struct of_platform_driver psycho_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = psycho_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = psycho_match,
},
.probe = psycho_probe, .probe = psycho_probe,
}; };

View file

@ -310,7 +310,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id)
static void sabre_register_error_handlers(struct pci_pbm_info *pbm) static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct device_node *dp = pbm->op->node; struct device_node *dp = pbm->op->dev.of_node;
struct of_device *op; struct of_device *op;
unsigned long base = pbm->controller_regs; unsigned long base = pbm->controller_regs;
u64 tmp; u64 tmp;
@ -456,7 +456,7 @@ static int __devinit sabre_probe(struct of_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *pr_regs; const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
u32 upa_portid, dma_mask; u32 upa_portid, dma_mask;
struct iommu *iommu; struct iommu *iommu;
@ -596,8 +596,11 @@ static struct of_device_id __initdata sabre_match[] = {
}; };
static struct of_platform_driver sabre_driver = { static struct of_platform_driver sabre_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = sabre_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = sabre_match,
},
.probe = sabre_probe, .probe = sabre_probe,
}; };

View file

@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
*/ */
static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->node); struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
u64 tmp, err_mask, err_no_mask; u64 tmp, err_mask, err_no_mask;
int err; int err;
@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
static void schizo_register_error_handlers(struct pci_pbm_info *pbm) static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->node); struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
u64 tmp, err_mask, err_no_mask; u64 tmp, err_mask, err_no_mask;
int err; int err;
@ -1068,7 +1068,7 @@ static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm,
{ {
pbm_config_busmastering(pbm); pbm_config_busmastering(pbm);
pbm->is_66mhz_capable = pbm->is_66mhz_capable =
(of_find_property(pbm->op->node, "66mhz-capable", NULL) (of_find_property(pbm->op->dev.of_node, "66mhz-capable", NULL)
!= NULL); != NULL);
pbm->pci_bus = pci_scan_one_pbm(pbm, parent); pbm->pci_bus = pci_scan_one_pbm(pbm, parent);
@ -1138,7 +1138,7 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
u32 dma_mask; u32 dma_mask;
u64 control; u64 control;
vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL);
if (!vdma) if (!vdma)
vdma = vdma_default; vdma = vdma_default;
@ -1268,7 +1268,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
pbm->chip_version >= 0x2) pbm->chip_version >= 0x2)
tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT;
if (!of_find_property(pbm->op->node, "no-bus-parking", NULL)) if (!of_find_property(pbm->op->dev.of_node, "no-bus-parking", NULL))
tmp |= SCHIZO_PCICTRL_PARK; tmp |= SCHIZO_PCICTRL_PARK;
else else
tmp &= ~SCHIZO_PCICTRL_PARK; tmp &= ~SCHIZO_PCICTRL_PARK;
@ -1311,7 +1311,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm,
int chip_type) int chip_type)
{ {
const struct linux_prom64_registers *regs; const struct linux_prom64_registers *regs;
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
const char *chipset_name; const char *chipset_name;
int is_pbm_a, err; int is_pbm_a, err;
@ -1415,7 +1415,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,
static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
struct iommu *iommu; struct iommu *iommu;
u32 portid; u32 portid;
@ -1491,8 +1491,11 @@ static struct of_device_id __initdata schizo_match[] = {
}; };
static struct of_platform_driver schizo_driver = { static struct of_platform_driver schizo_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = schizo_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = schizo_match,
},
.probe = schizo_probe, .probe = schizo_probe,
}; };

View file

@ -540,7 +540,7 @@ static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm,
struct property *prop; struct property *prop;
struct device_node *dp; struct device_node *dp;
dp = pbm->op->node; dp = pbm->op->dev.of_node;
prop = of_find_property(dp, "66mhz-capable", NULL); prop = of_find_property(dp, "66mhz-capable", NULL);
pbm->is_66mhz_capable = (prop != NULL); pbm->is_66mhz_capable = (prop != NULL);
pbm->pci_bus = pci_scan_one_pbm(pbm, parent); pbm->pci_bus = pci_scan_one_pbm(pbm, parent);
@ -584,7 +584,7 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
u32 dma_mask, dma_offset; u32 dma_mask, dma_offset;
const u32 *vdma; const u32 *vdma;
vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL);
if (!vdma) if (!vdma)
vdma = vdma_default; vdma = vdma_default;
@ -881,7 +881,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 devhandle) struct of_device *op, u32 devhandle)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
int err; int err;
pbm->numa_node = of_node_to_nid(dp); pbm->numa_node = of_node_to_nid(dp);
@ -929,7 +929,7 @@ static int __devinit pci_sun4v_probe(struct of_device *op,
u32 devhandle; u32 devhandle;
int i, err; int i, err;
dp = op->node; dp = op->dev.of_node;
if (!hvapi_negotiated++) { if (!hvapi_negotiated++) {
err = sun4v_hvapi_register(HV_GRP_PCI, err = sun4v_hvapi_register(HV_GRP_PCI,
@ -1009,8 +1009,11 @@ static struct of_device_id __initdata pci_sun4v_match[] = {
}; };
static struct of_platform_driver pci_sun4v_driver = { static struct of_platform_driver pci_sun4v_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = pci_sun4v_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = pci_sun4v_match,
},
.probe = pci_sun4v_probe, .probe = pci_sun4v_probe,
}; };

View file

@ -79,8 +79,11 @@ static struct of_device_id __initdata pmc_match[] = {
MODULE_DEVICE_TABLE(of, pmc_match); MODULE_DEVICE_TABLE(of, pmc_match);
static struct of_platform_driver pmc_driver = { static struct of_platform_driver pmc_driver = {
.name = "pmc", .driver = {
.match_table = pmc_match, .name = "pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_match,
},
.probe = pmc_probe, .probe = pmc_probe,
}; };

View file

@ -41,9 +41,9 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
power_reg = of_ioremap(res, 0, 0x4, "power"); power_reg = of_ioremap(res, 0, 0x4, "power");
printk(KERN_INFO "%s: Control reg at %llx\n", printk(KERN_INFO "%s: Control reg at %llx\n",
op->node->name, res->start); op->dev.of_node->name, res->start);
if (has_button_interrupt(irq, op->node)) { if (has_button_interrupt(irq, op->dev.of_node)) {
if (request_irq(irq, if (request_irq(irq,
power_handler, 0, "power", NULL) < 0) power_handler, 0, "power", NULL) < 0)
printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); printk(KERN_ERR "power: Cannot setup IRQ handler.\n");
@ -60,10 +60,11 @@ static struct of_device_id __initdata power_match[] = {
}; };
static struct of_platform_driver power_driver = { static struct of_platform_driver power_driver = {
.match_table = power_match,
.probe = power_probe, .probe = power_probe,
.driver = { .driver = {
.name = "power", .name = "power",
.owner = THIS_MODULE,
.of_match_table = power_match,
}, },
}; };

View file

@ -450,7 +450,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op,
const char *chip_name, int chip_type) const char *chip_name, int chip_type)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
pbm->name = dp->full_name; pbm->name = dp->full_name;
pbm->numa_node = -1; pbm->numa_node = -1;

View file

@ -63,10 +63,10 @@ void sbus_set_sbus64(struct device *dev, int bursts)
int slot; int slot;
u64 val; u64 val;
regs = of_get_property(op->node, "reg", NULL); regs = of_get_property(op->dev.of_node, "reg", NULL);
if (!regs) { if (!regs) {
printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n", printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n",
op->node->full_name); op->dev.of_node->full_name);
return; return;
} }
slot = regs->which_io; slot = regs->which_io;
@ -287,7 +287,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR); SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR);
upa_writeq(error_bits, afsr_reg); upa_writeq(error_bits, afsr_reg);
portid = of_getintprop_default(op->node, "portid", -1); portid = of_getintprop_default(op->dev.of_node, "portid", -1);
/* Log the error. */ /* Log the error. */
printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n", printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n",
@ -361,7 +361,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR); SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR);
upa_writeq(error_bits, afsr_reg); upa_writeq(error_bits, afsr_reg);
portid = of_getintprop_default(op->node, "portid", -1); portid = of_getintprop_default(op->dev.of_node, "portid", -1);
printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n", printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n",
portid, portid,
@ -439,7 +439,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR); SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR);
upa_writeq(error_bits, afsr_reg); upa_writeq(error_bits, afsr_reg);
portid = of_getintprop_default(op->node, "portid", -1); portid = of_getintprop_default(op->dev.of_node, "portid", -1);
/* Log the error. */ /* Log the error. */
printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n", printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n",
@ -496,7 +496,7 @@ static void __init sysio_register_error_handlers(struct of_device *op)
u64 control; u64 control;
int portid; int portid;
portid = of_getintprop_default(op->node, "portid", -1); portid = of_getintprop_default(op->dev.of_node, "portid", -1);
irq = sbus_build_irq(op, SYSIO_UE_INO); irq = sbus_build_irq(op, SYSIO_UE_INO);
if (request_irq(irq, sysio_ue_handler, 0, if (request_irq(irq, sysio_ue_handler, 0,
@ -537,7 +537,7 @@ static void __init sysio_register_error_handlers(struct of_device *op)
static void __init sbus_iommu_init(struct of_device *op) static void __init sbus_iommu_init(struct of_device *op)
{ {
const struct linux_prom64_registers *pr; const struct linux_prom64_registers *pr;
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
struct iommu *iommu; struct iommu *iommu;
struct strbuf *strbuf; struct strbuf *strbuf;
unsigned long regs, reg_base; unsigned long regs, reg_base;
@ -589,7 +589,7 @@ static void __init sbus_iommu_init(struct of_device *op)
*/ */
iommu->write_complete_reg = regs + 0x2000UL; iommu->write_complete_reg = regs + 0x2000UL;
portid = of_getintprop_default(op->node, "portid", -1); portid = of_getintprop_default(op->dev.of_node, "portid", -1);
printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n", printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n",
portid, regs); portid, regs);

View file

@ -144,7 +144,7 @@ static struct platform_device m48t59_rtc = {
static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
const char *model = of_get_property(dp, "model", NULL); const char *model = of_get_property(dp, "model", NULL);
if (!model) if (!model)
@ -177,10 +177,11 @@ static struct of_device_id __initdata clock_match[] = {
}; };
static struct of_platform_driver clock_driver = { static struct of_platform_driver clock_driver = {
.match_table = clock_match,
.probe = clock_probe, .probe = clock_probe,
.driver = { .driver = {
.name = "rtc", .name = "rtc",
.owner = THIS_MODULE,
.of_match_table = clock_match,
}, },
}; };

View file

@ -424,7 +424,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *
struct resource *r; struct resource *r;
printk(KERN_INFO "%s: RTC regs at 0x%llx\n", printk(KERN_INFO "%s: RTC regs at 0x%llx\n",
op->node->full_name, op->resource[0].start); op->dev.of_node->full_name, op->resource[0].start);
/* The CMOS RTC driver only accepts IORESOURCE_IO, so cons /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
* up a fake resource so that the probe works for all cases. * up a fake resource so that the probe works for all cases.
@ -463,10 +463,11 @@ static struct of_device_id __initdata rtc_match[] = {
}; };
static struct of_platform_driver rtc_driver = { static struct of_platform_driver rtc_driver = {
.match_table = rtc_match,
.probe = rtc_probe, .probe = rtc_probe,
.driver = { .driver = {
.name = "rtc", .name = "rtc",
.owner = THIS_MODULE,
.of_match_table = rtc_match,
}, },
}; };
@ -480,7 +481,7 @@ static int __devinit bq4802_probe(struct of_device *op, const struct of_device_i
{ {
printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
op->node->full_name, op->resource[0].start); op->dev.of_node->full_name, op->resource[0].start);
rtc_bq4802_device.resource = &op->resource[0]; rtc_bq4802_device.resource = &op->resource[0];
return platform_device_register(&rtc_bq4802_device); return platform_device_register(&rtc_bq4802_device);
@ -495,10 +496,11 @@ static struct of_device_id __initdata bq4802_match[] = {
}; };
static struct of_platform_driver bq4802_driver = { static struct of_platform_driver bq4802_driver = {
.match_table = bq4802_match,
.probe = bq4802_probe, .probe = bq4802_probe,
.driver = { .driver = {
.name = "bq4802", .name = "bq4802",
.owner = THIS_MODULE,
.of_match_table = bq4802_match,
}, },
}; };
@ -534,7 +536,7 @@ static struct platform_device m48t59_rtc = {
static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
/* On an Enterprise system there can be multiple mostek clocks. /* On an Enterprise system there can be multiple mostek clocks.
* We should only match the one that is on the central FHC bus. * We should only match the one that is on the central FHC bus.
@ -558,10 +560,11 @@ static struct of_device_id __initdata mostek_match[] = {
}; };
static struct of_platform_driver mostek_driver = { static struct of_platform_driver mostek_driver = {
.match_table = mostek_match,
.probe = mostek_probe, .probe = mostek_probe,
.driver = { .driver = {
.name = "mostek", .name = "mostek",
.owner = THIS_MODULE,
.of_match_table = mostek_match,
}, },
}; };

View file

@ -1140,7 +1140,7 @@ static int __devinit pata_macio_attach(struct macio_dev *mdev,
"Failed to allocate private memory\n"); "Failed to allocate private memory\n");
return -ENOMEM; return -ENOMEM;
} }
priv->node = of_node_get(mdev->ofdev.node); priv->node = of_node_get(mdev->ofdev.dev.of_node);
priv->mdev = mdev; priv->mdev = mdev;
priv->dev = &mdev->ofdev.dev; priv->dev = &mdev->ofdev.dev;

View file

@ -694,7 +694,7 @@ mpc52xx_ata_probe(struct of_device *op, const struct of_device_id *match)
struct bcom_task *dmatsk = NULL; struct bcom_task *dmatsk = NULL;
/* Get ipb frequency */ /* Get ipb frequency */
ipb_freq = mpc5xxx_get_bus_frequency(op->node); ipb_freq = mpc5xxx_get_bus_frequency(op->dev.of_node);
if (!ipb_freq) { if (!ipb_freq) {
dev_err(&op->dev, "could not determine IPB bus frequency\n"); dev_err(&op->dev, "could not determine IPB bus frequency\n");
return -ENODEV; return -ENODEV;
@ -702,7 +702,7 @@ mpc52xx_ata_probe(struct of_device *op, const struct of_device_id *match)
/* Get device base address from device tree, request the region /* Get device base address from device tree, request the region
* and ioremap it. */ * and ioremap it. */
rv = of_address_to_resource(op->node, 0, &res_mem); rv = of_address_to_resource(op->dev.of_node, 0, &res_mem);
if (rv) { if (rv) {
dev_err(&op->dev, "could not determine device base address\n"); dev_err(&op->dev, "could not determine device base address\n");
return rv; return rv;
@ -735,14 +735,14 @@ mpc52xx_ata_probe(struct of_device *op, const struct of_device_id *match)
* The MPC5200 ATA controller supports MWDMA modes 0, 1 and 2 and * The MPC5200 ATA controller supports MWDMA modes 0, 1 and 2 and
* UDMA modes 0, 1 and 2. * UDMA modes 0, 1 and 2.
*/ */
prop = of_get_property(op->node, "mwdma-mode", &proplen); prop = of_get_property(op->dev.of_node, "mwdma-mode", &proplen);
if ((prop) && (proplen >= 4)) if ((prop) && (proplen >= 4))
mwdma_mask = ATA_MWDMA2 & ((1 << (*prop + 1)) - 1); mwdma_mask = ATA_MWDMA2 & ((1 << (*prop + 1)) - 1);
prop = of_get_property(op->node, "udma-mode", &proplen); prop = of_get_property(op->dev.of_node, "udma-mode", &proplen);
if ((prop) && (proplen >= 4)) if ((prop) && (proplen >= 4))
udma_mask = ATA_UDMA2 & ((1 << (*prop + 1)) - 1); udma_mask = ATA_UDMA2 & ((1 << (*prop + 1)) - 1);
ata_irq = irq_of_parse_and_map(op->node, 0); ata_irq = irq_of_parse_and_map(op->dev.of_node, 0);
if (ata_irq == NO_IRQ) { if (ata_irq == NO_IRQ) {
dev_err(&op->dev, "error mapping irq\n"); dev_err(&op->dev, "error mapping irq\n");
return -EINVAL; return -EINVAL;
@ -884,9 +884,6 @@ static struct of_device_id mpc52xx_ata_of_match[] = {
static struct of_platform_driver mpc52xx_ata_of_platform_driver = { static struct of_platform_driver mpc52xx_ata_of_platform_driver = {
.owner = THIS_MODULE,
.name = DRV_NAME,
.match_table = mpc52xx_ata_of_match,
.probe = mpc52xx_ata_probe, .probe = mpc52xx_ata_probe,
.remove = mpc52xx_ata_remove, .remove = mpc52xx_ata_remove,
#ifdef CONFIG_PM #ifdef CONFIG_PM
@ -896,6 +893,7 @@ static struct of_platform_driver mpc52xx_ata_of_platform_driver = {
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = mpc52xx_ata_of_match,
}, },
}; };

View file

@ -18,7 +18,7 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
int ret; int ret;
struct device_node *dn = ofdev->node; struct device_node *dn = ofdev->dev.of_node;
struct resource io_res; struct resource io_res;
struct resource ctl_res; struct resource ctl_res;
struct resource irq_res; struct resource irq_res;
@ -91,8 +91,11 @@ static struct of_device_id pata_of_platform_match[] = {
MODULE_DEVICE_TABLE(of, pata_of_platform_match); MODULE_DEVICE_TABLE(of, pata_of_platform_match);
static struct of_platform_driver pata_of_platform_driver = { static struct of_platform_driver pata_of_platform_driver = {
.name = "pata_of_platform", .driver = {
.match_table = pata_of_platform_match, .name = "pata_of_platform",
.owner = THIS_MODULE,
.of_match_table = pata_of_platform_match,
},
.probe = pata_of_platform_probe, .probe = pata_of_platform_probe,
.remove = __devexit_p(pata_of_platform_remove), .remove = __devexit_p(pata_of_platform_remove),
}; };

View file

@ -1313,7 +1313,7 @@ static int sata_fsl_probe(struct of_device *ofdev,
dev_printk(KERN_INFO, &ofdev->dev, dev_printk(KERN_INFO, &ofdev->dev,
"Sata FSL Platform/CSB Driver init\n"); "Sata FSL Platform/CSB Driver init\n");
hcr_base = of_iomap(ofdev->node, 0); hcr_base = of_iomap(ofdev->dev.of_node, 0);
if (!hcr_base) if (!hcr_base)
goto error_exit_with_cleanup; goto error_exit_with_cleanup;
@ -1332,7 +1332,7 @@ static int sata_fsl_probe(struct of_device *ofdev,
host_priv->ssr_base = ssr_base; host_priv->ssr_base = ssr_base;
host_priv->csr_base = csr_base; host_priv->csr_base = csr_base;
irq = irq_of_parse_and_map(ofdev->node, 0); irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
if (irq < 0) { if (irq < 0) {
dev_printk(KERN_ERR, &ofdev->dev, "invalid irq from platform\n"); dev_printk(KERN_ERR, &ofdev->dev, "invalid irq from platform\n");
goto error_exit_with_cleanup; goto error_exit_with_cleanup;
@ -1427,8 +1427,11 @@ static struct of_device_id fsl_sata_match[] = {
MODULE_DEVICE_TABLE(of, fsl_sata_match); MODULE_DEVICE_TABLE(of, fsl_sata_match);
static struct of_platform_driver fsl_sata_driver = { static struct of_platform_driver fsl_sata_driver = {
.name = "fsl-sata", .driver = {
.match_table = fsl_sata_match, .name = "fsl-sata",
.owner = THIS_MODULE,
.of_match_table = fsl_sata_match,
},
.probe = sata_fsl_probe, .probe = sata_fsl_probe,
.remove = sata_fsl_remove, .remove = sata_fsl_remove,
#ifdef CONFIG_PM #ifdef CONFIG_PM

View file

@ -789,7 +789,7 @@ static int __init fore200e_sba_map(struct fore200e *fore200e)
fore200e->bus->write(0x02, fore200e->regs.sba.isr); /* XXX hardwired interrupt level */ fore200e->bus->write(0x02, fore200e->regs.sba.isr); /* XXX hardwired interrupt level */
/* get the supported DVMA burst sizes */ /* get the supported DVMA burst sizes */
bursts = of_getintprop_default(op->node->parent, "burst-sizes", 0x00); bursts = of_getintprop_default(op->dev.of_node->parent, "burst-sizes", 0x00);
if (sbus_can_dma_64bit()) if (sbus_can_dma_64bit())
sbus_set_sbus64(&op->dev, bursts); sbus_set_sbus64(&op->dev, bursts);
@ -820,18 +820,20 @@ static int __init fore200e_sba_prom_read(struct fore200e *fore200e, struct prom_
const u8 *prop; const u8 *prop;
int len; int len;
prop = of_get_property(op->node, "madaddrlo2", &len); prop = of_get_property(op->dev.of_node, "madaddrlo2", &len);
if (!prop) if (!prop)
return -ENODEV; return -ENODEV;
memcpy(&prom->mac_addr[4], prop, 4); memcpy(&prom->mac_addr[4], prop, 4);
prop = of_get_property(op->node, "madaddrhi4", &len); prop = of_get_property(op->dev.of_node, "madaddrhi4", &len);
if (!prop) if (!prop)
return -ENODEV; return -ENODEV;
memcpy(&prom->mac_addr[2], prop, 4); memcpy(&prom->mac_addr[2], prop, 4);
prom->serial_number = of_getintprop_default(op->node, "serialnumber", 0); prom->serial_number = of_getintprop_default(op->dev.of_node,
prom->hw_revision = of_getintprop_default(op->node, "promversion", 0); "serialnumber", 0);
prom->hw_revision = of_getintprop_default(op->dev.of_node,
"promversion", 0);
return 0; return 0;
} }
@ -841,10 +843,10 @@ static int fore200e_sba_proc_read(struct fore200e *fore200e, char *page)
struct of_device *op = fore200e->bus_dev; struct of_device *op = fore200e->bus_dev;
const struct linux_prom_registers *regs; const struct linux_prom_registers *regs;
regs = of_get_property(op->node, "reg", NULL); regs = of_get_property(op->dev.of_node, "reg", NULL);
return sprintf(page, " SBUS slot/device:\t\t%d/'%s'\n", return sprintf(page, " SBUS slot/device:\t\t%d/'%s'\n",
(regs ? regs->which_io : 0), op->node->name); (regs ? regs->which_io : 0), op->dev.of_node->name);
} }
#endif /* CONFIG_SBUS */ #endif /* CONFIG_SBUS */
@ -2693,8 +2695,11 @@ static const struct of_device_id fore200e_sba_match[] = {
MODULE_DEVICE_TABLE(of, fore200e_sba_match); MODULE_DEVICE_TABLE(of, fore200e_sba_match);
static struct of_platform_driver fore200e_sba_driver = { static struct of_platform_driver fore200e_sba_driver = {
.name = "fore_200e", .driver = {
.match_table = fore200e_sba_match, .name = "fore_200e",
.owner = THIS_MODULE,
.of_match_table = fore200e_sba_match,
},
.probe = fore200e_sba_probe, .probe = fore200e_sba_probe,
.remove = __devexit_p(fore200e_sba_remove), .remove = __devexit_p(fore200e_sba_remove),
}; };

View file

@ -1004,7 +1004,7 @@ static const struct block_device_operations floppy_fops = {
static int swim3_add_device(struct macio_dev *mdev, int index) static int swim3_add_device(struct macio_dev *mdev, int index)
{ {
struct device_node *swim = mdev->ofdev.node; struct device_node *swim = mdev->ofdev.dev.of_node;
struct floppy_state *fs = &floppy_states[index]; struct floppy_state *fs = &floppy_states[index];
int rc = -EBUSY; int rc = -EBUSY;

View file

@ -1198,10 +1198,10 @@ ace_of_probe(struct of_device *op, const struct of_device_id *match)
dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match); dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match);
/* device id */ /* device id */
id = of_get_property(op->node, "port-number", NULL); id = of_get_property(op->dev.of_node, "port-number", NULL);
/* physaddr */ /* physaddr */
rc = of_address_to_resource(op->node, 0, &res); rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) { if (rc) {
dev_err(&op->dev, "invalid address\n"); dev_err(&op->dev, "invalid address\n");
return rc; return rc;
@ -1209,11 +1209,11 @@ ace_of_probe(struct of_device *op, const struct of_device_id *match)
physaddr = res.start; physaddr = res.start;
/* irq */ /* irq */
irq = irq_of_parse_and_map(op->node, 0); irq = irq_of_parse_and_map(op->dev.of_node, 0);
/* bus width */ /* bus width */
bus_width = ACE_BUS_WIDTH_16; bus_width = ACE_BUS_WIDTH_16;
if (of_find_property(op->node, "8-bit", NULL)) if (of_find_property(op->dev.of_node, "8-bit", NULL))
bus_width = ACE_BUS_WIDTH_8; bus_width = ACE_BUS_WIDTH_8;
/* Call the bus-independant setup code */ /* Call the bus-independant setup code */
@ -1237,13 +1237,12 @@ static const struct of_device_id ace_of_match[] __devinitconst = {
MODULE_DEVICE_TABLE(of, ace_of_match); MODULE_DEVICE_TABLE(of, ace_of_match);
static struct of_platform_driver ace_of_driver = { static struct of_platform_driver ace_of_driver = {
.owner = THIS_MODULE,
.name = "xsysace",
.match_table = ace_of_match,
.probe = ace_of_probe, .probe = ace_of_probe,
.remove = __devexit_p(ace_of_remove), .remove = __devexit_p(ace_of_remove),
.driver = { .driver = {
.name = "xsysace", .name = "xsysace",
.owner = THIS_MODULE,
.of_match_table = ace_of_match,
}, },
}; };

View file

@ -567,7 +567,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
struct disk_info *d; struct disk_info *d;
struct cdrom_device_info *c; struct cdrom_device_info *c;
struct request_queue *q; struct request_queue *q;
struct device_node *node = vdev->dev.archdata.of_node; struct device_node *node = vdev->dev.of_node;
deviceno = vdev->unit_address; deviceno = vdev->unit_address;
if (deviceno >= VIOCD_MAX_CD) if (deviceno >= VIOCD_MAX_CD)

View file

@ -660,7 +660,7 @@ static int __devinit n2rng_probe(struct of_device *op,
np->hvapi_major); np->hvapi_major);
goto out_hvapi_unregister; goto out_hvapi_unregister;
} }
np->num_units = of_getintprop_default(op->node, np->num_units = of_getintprop_default(op->dev.of_node,
"rng-#units", 0); "rng-#units", 0);
if (!np->num_units) { if (!np->num_units) {
dev_err(&op->dev, "VF RNG lacks rng-#units property\n"); dev_err(&op->dev, "VF RNG lacks rng-#units property\n");
@ -751,8 +751,11 @@ static const struct of_device_id n2rng_match[] = {
MODULE_DEVICE_TABLE(of, n2rng_match); MODULE_DEVICE_TABLE(of, n2rng_match);
static struct of_platform_driver n2rng_driver = { static struct of_platform_driver n2rng_driver = {
.name = "n2rng", .driver = {
.match_table = n2rng_match, .name = "n2rng",
.owner = THIS_MODULE,
.of_match_table = n2rng_match,
},
.probe = n2rng_probe, .probe = n2rng_probe,
.remove = __devexit_p(n2rng_remove), .remove = __devexit_p(n2rng_remove),
}; };

View file

@ -98,7 +98,7 @@ static int __devinit rng_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
void __iomem *rng_regs; void __iomem *rng_regs;
struct device_node *rng_np = ofdev->node; struct device_node *rng_np = ofdev->dev.of_node;
struct resource res; struct resource res;
int err = 0; int err = 0;
@ -140,8 +140,11 @@ static struct of_device_id rng_match[] = {
}; };
static struct of_platform_driver rng_driver = { static struct of_platform_driver rng_driver = {
.name = "pasemi-rng", .driver = {
.match_table = rng_match, .name = "pasemi-rng",
.owner = THIS_MODULE,
.of_match_table = rng_match,
},
.probe = rng_probe, .probe = rng_probe,
.remove = rng_remove, .remove = rng_remove,
}; };

View file

@ -2469,7 +2469,7 @@ static int __devinit ipmi_of_probe(struct of_device *dev,
struct smi_info *info; struct smi_info *info;
struct resource resource; struct resource resource;
const int *regsize, *regspacing, *regshift; const int *regsize, *regspacing, *regshift;
struct device_node *np = dev->node; struct device_node *np = dev->dev.of_node;
int ret; int ret;
int proplen; int proplen;
@ -2525,7 +2525,7 @@ static int __devinit ipmi_of_probe(struct of_device *dev,
info->io.regspacing = regspacing ? *regspacing : DEFAULT_REGSPACING; info->io.regspacing = regspacing ? *regspacing : DEFAULT_REGSPACING;
info->io.regshift = regshift ? *regshift : 0; info->io.regshift = regshift ? *regshift : 0;
info->irq = irq_of_parse_and_map(dev->node, 0); info->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
info->dev = &dev->dev; info->dev = &dev->dev;
dev_dbg(&dev->dev, "addr 0x%lx regsize %d spacing %d irq %x\n", dev_dbg(&dev->dev, "addr 0x%lx regsize %d spacing %d irq %x\n",
@ -2555,8 +2555,11 @@ static struct of_device_id ipmi_match[] =
}; };
static struct of_platform_driver ipmi_of_platform_driver = { static struct of_platform_driver ipmi_of_platform_driver = {
.name = "ipmi", .driver = {
.match_table = ipmi_match, .name = "ipmi",
.owner = THIS_MODULE,
.of_match_table = ipmi_match,
},
.probe = ipmi_of_probe, .probe = ipmi_of_probe,
.remove = __devexit_p(ipmi_of_remove), .remove = __devexit_p(ipmi_of_remove),
}; };

View file

@ -866,7 +866,7 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
{ {
int i = vdev->unit_address; int i = vdev->unit_address;
int j; int j;
struct device_node *node = vdev->dev.archdata.of_node; struct device_node *node = vdev->dev.of_node;
if (i >= VIOTAPE_MAX_TAPE) if (i >= VIOTAPE_MAX_TAPE)
return -ENODEV; return -ENODEV;

View file

@ -772,18 +772,18 @@ hwicap_of_probe(struct of_device *op, const struct of_device_id *match)
dev_dbg(&op->dev, "hwicap_of_probe(%p, %p)\n", op, match); dev_dbg(&op->dev, "hwicap_of_probe(%p, %p)\n", op, match);
rc = of_address_to_resource(op->node, 0, &res); rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) { if (rc) {
dev_err(&op->dev, "invalid address\n"); dev_err(&op->dev, "invalid address\n");
return rc; return rc;
} }
id = of_get_property(op->node, "port-number", NULL); id = of_get_property(op->dev.of_node, "port-number", NULL);
/* It's most likely that we're using V4, if the family is not /* It's most likely that we're using V4, if the family is not
specified */ specified */
regs = &v4_config_registers; regs = &v4_config_registers;
family = of_get_property(op->node, "xlnx,family", NULL); family = of_get_property(op->dev.of_node, "xlnx,family", NULL);
if (family) { if (family) {
if (!strcmp(family, "virtex2p")) { if (!strcmp(family, "virtex2p")) {
@ -812,13 +812,12 @@ static const struct of_device_id __devinitconst hwicap_of_match[] = {
MODULE_DEVICE_TABLE(of, hwicap_of_match); MODULE_DEVICE_TABLE(of, hwicap_of_match);
static struct of_platform_driver hwicap_of_driver = { static struct of_platform_driver hwicap_of_driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.match_table = hwicap_of_match,
.probe = hwicap_of_probe, .probe = hwicap_of_probe,
.remove = __devexit_p(hwicap_of_remove), .remove = __devexit_p(hwicap_of_remove),
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = hwicap_of_match,
}, },
}; };

View file

@ -1281,8 +1281,11 @@ static const struct of_device_id crypto4xx_match[] = {
}; };
static struct of_platform_driver crypto4xx_driver = { static struct of_platform_driver crypto4xx_driver = {
.name = "crypto4xx", .driver = {
.match_table = crypto4xx_match, .name = "crypto4xx",
.owner = THIS_MODULE,
.of_match_table = crypto4xx_match,
},
.probe = crypto4xx_probe, .probe = crypto4xx_probe,
.remove = crypto4xx_remove, .remove = crypto4xx_remove,
}; };

View file

@ -2398,7 +2398,7 @@ static int talitos_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
struct talitos_private *priv; struct talitos_private *priv;
const unsigned int *prop; const unsigned int *prop;
int i, err; int i, err;
@ -2573,8 +2573,11 @@ static const struct of_device_id talitos_match[] = {
MODULE_DEVICE_TABLE(of, talitos_match); MODULE_DEVICE_TABLE(of, talitos_match);
static struct of_platform_driver talitos_driver = { static struct of_platform_driver talitos_driver = {
.name = "talitos", .driver = {
.match_table = talitos_match, .name = "talitos",
.owner = THIS_MODULE,
.of_match_table = talitos_match,
},
.probe = talitos_probe, .probe = talitos_probe,
.remove = talitos_remove, .remove = talitos_remove,
}; };

View file

@ -1315,7 +1315,7 @@ static int __devinit fsldma_of_probe(struct of_device *op,
INIT_LIST_HEAD(&fdev->common.channels); INIT_LIST_HEAD(&fdev->common.channels);
/* ioremap the registers for use */ /* ioremap the registers for use */
fdev->regs = of_iomap(op->node, 0); fdev->regs = of_iomap(op->dev.of_node, 0);
if (!fdev->regs) { if (!fdev->regs) {
dev_err(&op->dev, "unable to ioremap registers\n"); dev_err(&op->dev, "unable to ioremap registers\n");
err = -ENOMEM; err = -ENOMEM;
@ -1323,7 +1323,7 @@ static int __devinit fsldma_of_probe(struct of_device *op,
} }
/* map the channel IRQ if it exists, but don't hookup the handler yet */ /* map the channel IRQ if it exists, but don't hookup the handler yet */
fdev->irq = irq_of_parse_and_map(op->node, 0); fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0);
dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);
@ -1345,7 +1345,7 @@ static int __devinit fsldma_of_probe(struct of_device *op,
* of_platform_bus_remove(). Instead, we manually instantiate every DMA * of_platform_bus_remove(). Instead, we manually instantiate every DMA
* channel object. * channel object.
*/ */
for_each_child_of_node(op->node, child) { for_each_child_of_node(op->dev.of_node, child) {
if (of_device_is_compatible(child, "fsl,eloplus-dma-channel")) { if (of_device_is_compatible(child, "fsl,eloplus-dma-channel")) {
fsl_dma_chan_probe(fdev, child, fsl_dma_chan_probe(fdev, child,
FSL_DMA_IP_85XX | FSL_DMA_BIG_ENDIAN, FSL_DMA_IP_85XX | FSL_DMA_BIG_ENDIAN,
@ -1411,10 +1411,13 @@ static const struct of_device_id fsldma_of_ids[] = {
}; };
static struct of_platform_driver fsldma_of_driver = { static struct of_platform_driver fsldma_of_driver = {
.name = "fsl-elo-dma", .driver = {
.match_table = fsldma_of_ids, .name = "fsl-elo-dma",
.probe = fsldma_of_probe, .owner = THIS_MODULE,
.remove = fsldma_of_remove, .of_match_table = fsldma_of_ids,
},
.probe = fsldma_of_probe,
.remove = fsldma_of_remove,
}; };
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/

View file

@ -4944,12 +4944,12 @@ static const struct of_device_id ppc440spe_adma_of_match[] __devinitconst = {
MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match); MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match);
static struct of_platform_driver ppc440spe_adma_driver = { static struct of_platform_driver ppc440spe_adma_driver = {
.match_table = ppc440spe_adma_of_match,
.probe = ppc440spe_adma_probe, .probe = ppc440spe_adma_probe,
.remove = __devexit_p(ppc440spe_adma_remove), .remove = __devexit_p(ppc440spe_adma_remove),
.driver = { .driver = {
.name = "PPC440SP(E)-ADMA", .name = "PPC440SP(E)-ADMA",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = ppc440spe_adma_of_match,
}, },
}; };

View file

@ -338,15 +338,13 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = {
}; };
static struct of_platform_driver mpc85xx_pci_err_driver = { static struct of_platform_driver mpc85xx_pci_err_driver = {
.owner = THIS_MODULE,
.name = "mpc85xx_pci_err",
.match_table = mpc85xx_pci_err_of_match,
.probe = mpc85xx_pci_err_probe, .probe = mpc85xx_pci_err_probe,
.remove = __devexit_p(mpc85xx_pci_err_remove), .remove = __devexit_p(mpc85xx_pci_err_remove),
.driver = { .driver = {
.name = "mpc85xx_pci_err", .name = "mpc85xx_pci_err",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, .of_match_table = mpc85xx_pci_err_of_match,
},
}; };
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
@ -654,15 +652,13 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
}; };
static struct of_platform_driver mpc85xx_l2_err_driver = { static struct of_platform_driver mpc85xx_l2_err_driver = {
.owner = THIS_MODULE,
.name = "mpc85xx_l2_err",
.match_table = mpc85xx_l2_err_of_match,
.probe = mpc85xx_l2_err_probe, .probe = mpc85xx_l2_err_probe,
.remove = mpc85xx_l2_err_remove, .remove = mpc85xx_l2_err_remove,
.driver = { .driver = {
.name = "mpc85xx_l2_err", .name = "mpc85xx_l2_err",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, .of_match_table = mpc85xx_l2_err_of_match,
},
}; };
/**************************** MC Err device ***************************/ /**************************** MC Err device ***************************/
@ -1131,15 +1127,13 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
}; };
static struct of_platform_driver mpc85xx_mc_err_driver = { static struct of_platform_driver mpc85xx_mc_err_driver = {
.owner = THIS_MODULE,
.name = "mpc85xx_mc_err",
.match_table = mpc85xx_mc_err_of_match,
.probe = mpc85xx_mc_err_probe, .probe = mpc85xx_mc_err_probe,
.remove = mpc85xx_mc_err_remove, .remove = mpc85xx_mc_err_remove,
.driver = { .driver = {
.name = "mpc85xx_mc_err", .name = "mpc85xx_mc_err",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, .of_match_table = mpc85xx_mc_err_of_match,
},
}; };
#ifdef CONFIG_MPC85xx #ifdef CONFIG_MPC85xx

View file

@ -202,13 +202,13 @@ static struct of_device_id ppc4xx_edac_match[] = {
}; };
static struct of_platform_driver ppc4xx_edac_driver = { static struct of_platform_driver ppc4xx_edac_driver = {
.match_table = ppc4xx_edac_match,
.probe = ppc4xx_edac_probe, .probe = ppc4xx_edac_probe,
.remove = ppc4xx_edac_remove, .remove = ppc4xx_edac_remove,
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = PPC4XX_EDAC_MODULE_NAME .name = PPC4XX_EDAC_MODULE_NAME
} .of_match_table = ppc4xx_edac_match,
},
}; };
/* /*

View file

@ -449,7 +449,7 @@ pca953x_get_alt_pdata(struct i2c_client *client)
struct device_node *node; struct device_node *node;
const uint16_t *val; const uint16_t *val;
node = dev_archdata_get_node(&client->dev.archdata); node = client->dev.of_node;
if (node == NULL) if (node == NULL)
return NULL; return NULL;

View file

@ -300,8 +300,11 @@ static const struct of_device_id env_match[] = {
MODULE_DEVICE_TABLE(of, env_match); MODULE_DEVICE_TABLE(of, env_match);
static struct of_platform_driver env_driver = { static struct of_platform_driver env_driver = {
.name = "ultra45_env", .driver = {
.match_table = env_match, .name = "ultra45_env",
.owner = THIS_MODULE,
.of_match_table = env_match,
},
.probe = env_probe, .probe = env_probe,
.remove = __devexit_p(env_remove), .remove = __devexit_p(env_remove),
}; };

View file

@ -440,7 +440,7 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
init_waitqueue_head(&cpm->i2c_wait); init_waitqueue_head(&cpm->i2c_wait);
cpm->irq = of_irq_to_resource(ofdev->node, 0, NULL); cpm->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
if (!cpm->irq) if (!cpm->irq)
return -EINVAL; return -EINVAL;
@ -451,13 +451,13 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
return ret; return ret;
/* I2C parameter RAM */ /* I2C parameter RAM */
i2c_base = of_iomap(ofdev->node, 1); i2c_base = of_iomap(ofdev->dev.of_node, 1);
if (i2c_base == NULL) { if (i2c_base == NULL) {
ret = -EINVAL; ret = -EINVAL;
goto out_irq; goto out_irq;
} }
if (of_device_is_compatible(ofdev->node, "fsl,cpm1-i2c")) { if (of_device_is_compatible(ofdev->dev.of_node, "fsl,cpm1-i2c")) {
/* Check for and use a microcode relocation patch. */ /* Check for and use a microcode relocation patch. */
cpm->i2c_ram = i2c_base; cpm->i2c_ram = i2c_base;
@ -474,7 +474,7 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
cpm->version = 1; cpm->version = 1;
} else if (of_device_is_compatible(ofdev->node, "fsl,cpm2-i2c")) { } else if (of_device_is_compatible(ofdev->dev.of_node, "fsl,cpm2-i2c")) {
cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64); cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64);
cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr); cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr);
out_be16(i2c_base, cpm->i2c_addr); out_be16(i2c_base, cpm->i2c_addr);
@ -489,24 +489,24 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
} }
/* I2C control/status registers */ /* I2C control/status registers */
cpm->i2c_reg = of_iomap(ofdev->node, 0); cpm->i2c_reg = of_iomap(ofdev->dev.of_node, 0);
if (cpm->i2c_reg == NULL) { if (cpm->i2c_reg == NULL) {
ret = -EINVAL; ret = -EINVAL;
goto out_ram; goto out_ram;
} }
data = of_get_property(ofdev->node, "fsl,cpm-command", &len); data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
if (!data || len != 4) { if (!data || len != 4) {
ret = -EINVAL; ret = -EINVAL;
goto out_reg; goto out_reg;
} }
cpm->cp_command = *data; cpm->cp_command = *data;
data = of_get_property(ofdev->node, "linux,i2c-class", &len); data = of_get_property(ofdev->dev.of_node, "linux,i2c-class", &len);
if (data && len == 4) if (data && len == 4)
cpm->adap.class = *data; cpm->adap.class = *data;
data = of_get_property(ofdev->node, "clock-frequency", &len); data = of_get_property(ofdev->dev.of_node, "clock-frequency", &len);
if (data && len == 4) if (data && len == 4)
cpm->freq = *data; cpm->freq = *data;
else else
@ -661,7 +661,7 @@ static int __devinit cpm_i2c_probe(struct of_device *ofdev,
/* register new adapter to i2c module... */ /* register new adapter to i2c module... */
data = of_get_property(ofdev->node, "linux,i2c-index", &len); data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
if (data && len == 4) { if (data && len == 4) {
cpm->adap.nr = *data; cpm->adap.nr = *data;
result = i2c_add_numbered_adapter(&cpm->adap); result = i2c_add_numbered_adapter(&cpm->adap);
@ -679,7 +679,7 @@ static int __devinit cpm_i2c_probe(struct of_device *ofdev,
/* /*
* register OF I2C devices * register OF I2C devices
*/ */
of_register_i2c_devices(&cpm->adap, ofdev->node); of_register_i2c_devices(&cpm->adap, ofdev->dev.of_node);
return 0; return 0;
out_shut: out_shut:
@ -718,13 +718,13 @@ static const struct of_device_id cpm_i2c_match[] = {
MODULE_DEVICE_TABLE(of, cpm_i2c_match); MODULE_DEVICE_TABLE(of, cpm_i2c_match);
static struct of_platform_driver cpm_i2c_driver = { static struct of_platform_driver cpm_i2c_driver = {
.match_table = cpm_i2c_match,
.probe = cpm_i2c_probe, .probe = cpm_i2c_probe,
.remove = __devexit_p(cpm_i2c_remove), .remove = __devexit_p(cpm_i2c_remove),
.driver = { .driver = {
.name = "fsl-i2c-cpm", .name = "fsl-i2c-cpm",
.owner = THIS_MODULE, .owner = THIS_MODULE,
} .of_match_table = cpm_i2c_match,
},
}; };
static int __init cpm_i2c_init(void) static int __init cpm_i2c_init(void)

View file

@ -664,7 +664,7 @@ static inline u8 iic_clckdiv(unsigned int opb)
static int __devinit iic_request_irq(struct of_device *ofdev, static int __devinit iic_request_irq(struct of_device *ofdev,
struct ibm_iic_private *dev) struct ibm_iic_private *dev)
{ {
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
int irq; int irq;
if (iic_force_poll) if (iic_force_poll)
@ -695,7 +695,7 @@ static int __devinit iic_request_irq(struct of_device *ofdev,
static int __devinit iic_probe(struct of_device *ofdev, static int __devinit iic_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
struct ibm_iic_private *dev; struct ibm_iic_private *dev;
struct i2c_adapter *adap; struct i2c_adapter *adap;
const u32 *freq; const u32 *freq;
@ -807,8 +807,11 @@ static const struct of_device_id ibm_iic_match[] = {
}; };
static struct of_platform_driver ibm_iic_driver = { static struct of_platform_driver ibm_iic_driver = {
.name = "ibm-iic", .driver = {
.match_table = ibm_iic_match, .name = "ibm-iic",
.owner = THIS_MODULE,
.of_match_table = ibm_iic_match,
},
.probe = iic_probe, .probe = iic_probe,
.remove = __devexit_p(iic_remove), .remove = __devexit_p(iic_remove),
}; };

View file

@ -560,14 +560,14 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
init_waitqueue_head(&i2c->queue); init_waitqueue_head(&i2c->queue);
i2c->base = of_iomap(op->node, 0); i2c->base = of_iomap(op->dev.of_node, 0);
if (!i2c->base) { if (!i2c->base) {
dev_err(i2c->dev, "failed to map controller\n"); dev_err(i2c->dev, "failed to map controller\n");
result = -ENOMEM; result = -ENOMEM;
goto fail_map; goto fail_map;
} }
i2c->irq = irq_of_parse_and_map(op->node, 0); i2c->irq = irq_of_parse_and_map(op->dev.of_node, 0);
if (i2c->irq) { /* no i2c->irq implies polling */ if (i2c->irq) { /* no i2c->irq implies polling */
result = request_irq(i2c->irq, mpc_i2c_isr, result = request_irq(i2c->irq, mpc_i2c_isr,
IRQF_SHARED, "i2c-mpc", i2c); IRQF_SHARED, "i2c-mpc", i2c);
@ -577,21 +577,22 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
} }
} }
if (of_get_property(op->node, "fsl,preserve-clocking", NULL)) { if (of_get_property(op->dev.of_node, "fsl,preserve-clocking", NULL)) {
clock = MPC_I2C_CLOCK_PRESERVE; clock = MPC_I2C_CLOCK_PRESERVE;
} else { } else {
prop = of_get_property(op->node, "clock-frequency", &plen); prop = of_get_property(op->dev.of_node, "clock-frequency",
&plen);
if (prop && plen == sizeof(u32)) if (prop && plen == sizeof(u32))
clock = *prop; clock = *prop;
} }
if (match->data) { if (match->data) {
struct mpc_i2c_data *data = match->data; struct mpc_i2c_data *data = match->data;
data->setup(op->node, i2c, clock, data->prescaler); data->setup(op->dev.of_node, i2c, clock, data->prescaler);
} else { } else {
/* Backwards compatibility */ /* Backwards compatibility */
if (of_get_property(op->node, "dfsrr", NULL)) if (of_get_property(op->dev.of_node, "dfsrr", NULL))
mpc_i2c_setup_8xxx(op->node, i2c, clock, 0); mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock, 0);
} }
dev_set_drvdata(&op->dev, i2c); dev_set_drvdata(&op->dev, i2c);
@ -605,7 +606,7 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
dev_err(i2c->dev, "failed to add adapter\n"); dev_err(i2c->dev, "failed to add adapter\n");
goto fail_add; goto fail_add;
} }
of_register_i2c_devices(&i2c->adap, op->node); of_register_i2c_devices(&i2c->adap, op->dev.of_node);
return result; return result;
@ -674,12 +675,12 @@ MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
/* Structure for a device driver */ /* Structure for a device driver */
static struct of_platform_driver mpc_i2c_driver = { static struct of_platform_driver mpc_i2c_driver = {
.match_table = mpc_i2c_of_match,
.probe = fsl_i2c_probe, .probe = fsl_i2c_probe,
.remove = __devexit_p(fsl_i2c_remove), .remove = __devexit_p(fsl_i2c_remove),
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = DRV_NAME, .name = DRV_NAME,
.of_match_table = mpc_i2c_of_match,
}, },
}; };

View file

@ -418,6 +418,9 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
client->dev.parent = &client->adapter->dev; client->dev.parent = &client->adapter->dev;
client->dev.bus = &i2c_bus_type; client->dev.bus = &i2c_bus_type;
client->dev.type = &i2c_client_type; client->dev.type = &i2c_client_type;
#ifdef CONFIG_OF
client->dev.of_node = info->of_node;
#endif
dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adap), dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adap),
client->addr); client->addr);

View file

@ -1153,7 +1153,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
if (macio_resource_count(mdev) == 0) { if (macio_resource_count(mdev) == 0) {
printk(KERN_WARNING "ide-pmac: no address for %s\n", printk(KERN_WARNING "ide-pmac: no address for %s\n",
mdev->ofdev.node->full_name); mdev->ofdev.dev.of_node->full_name);
rc = -ENXIO; rc = -ENXIO;
goto out_free_pmif; goto out_free_pmif;
} }
@ -1161,7 +1161,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
/* Request memory resource for IO ports */ /* Request memory resource for IO ports */
if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) { if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) {
printk(KERN_ERR "ide-pmac: can't request MMIO resource for " printk(KERN_ERR "ide-pmac: can't request MMIO resource for "
"%s!\n", mdev->ofdev.node->full_name); "%s!\n", mdev->ofdev.dev.of_node->full_name);
rc = -EBUSY; rc = -EBUSY;
goto out_free_pmif; goto out_free_pmif;
} }
@ -1173,7 +1173,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
*/ */
if (macio_irq_count(mdev) == 0) { if (macio_irq_count(mdev) == 0) {
printk(KERN_WARNING "ide-pmac: no intrs for device %s, using " printk(KERN_WARNING "ide-pmac: no intrs for device %s, using "
"13\n", mdev->ofdev.node->full_name); "13\n", mdev->ofdev.dev.of_node->full_name);
irq = irq_create_mapping(NULL, 13); irq = irq_create_mapping(NULL, 13);
} else } else
irq = macio_irq(mdev, 0); irq = macio_irq(mdev, 0);
@ -1182,7 +1182,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
regbase = (unsigned long) base; regbase = (unsigned long) base;
pmif->mdev = mdev; pmif->mdev = mdev;
pmif->node = mdev->ofdev.node; pmif->node = mdev->ofdev.dev.of_node;
pmif->regbase = regbase; pmif->regbase = regbase;
pmif->irq = irq; pmif->irq = irq;
pmif->kauai_fcr = NULL; pmif->kauai_fcr = NULL;
@ -1191,7 +1191,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
if (macio_request_resource(mdev, 1, "ide-pmac (dma)")) if (macio_request_resource(mdev, 1, "ide-pmac (dma)"))
printk(KERN_WARNING "ide-pmac: can't request DMA " printk(KERN_WARNING "ide-pmac: can't request DMA "
"resource for %s!\n", "resource for %s!\n",
mdev->ofdev.node->full_name); mdev->ofdev.dev.of_node->full_name);
else else
pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 0x1000); pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 0x1000);
} else } else

View file

@ -291,8 +291,9 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
}; };
ehca_gen_dbg("Probing adapter %s...", ehca_gen_dbg("Probing adapter %s...",
shca->ofdev->node->full_name); shca->ofdev->dev.of_node->full_name);
loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL); loc_code = of_get_property(shca->ofdev->dev.of_node, "ibm,loc-code",
NULL);
if (loc_code) if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code); ehca_gen_dbg(" ... location lode=%s", loc_code);
@ -720,16 +721,16 @@ static int __devinit ehca_probe(struct of_device *dev,
int ret, i, eq_size; int ret, i, eq_size;
unsigned long flags; unsigned long flags;
handle = of_get_property(dev->node, "ibm,hca-handle", NULL); handle = of_get_property(dev->dev.of_node, "ibm,hca-handle", NULL);
if (!handle) { if (!handle) {
ehca_gen_err("Cannot get eHCA handle for adapter: %s.", ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
dev->node->full_name); dev->dev.of_node->full_name);
return -ENODEV; return -ENODEV;
} }
if (!(*handle)) { if (!(*handle)) {
ehca_gen_err("Wrong eHCA handle for adapter: %s.", ehca_gen_err("Wrong eHCA handle for adapter: %s.",
dev->node->full_name); dev->dev.of_node->full_name);
return -ENODEV; return -ENODEV;
} }
@ -936,12 +937,13 @@ static struct of_device_id ehca_device_table[] =
MODULE_DEVICE_TABLE(of, ehca_device_table); MODULE_DEVICE_TABLE(of, ehca_device_table);
static struct of_platform_driver ehca_driver = { static struct of_platform_driver ehca_driver = {
.name = "ehca",
.match_table = ehca_device_table,
.probe = ehca_probe, .probe = ehca_probe,
.remove = ehca_remove, .remove = ehca_remove,
.driver = { .driver = {
.name = "ehca",
.owner = THIS_MODULE,
.groups = ehca_drv_attr_groups, .groups = ehca_drv_attr_groups,
.of_match_table = ehca_device_table,
}, },
}; };

View file

@ -259,8 +259,11 @@ static const struct of_device_id bbc_beep_match[] = {
}; };
static struct of_platform_driver bbc_beep_driver = { static struct of_platform_driver bbc_beep_driver = {
.name = "bbcbeep", .driver = {
.match_table = bbc_beep_match, .name = "bbcbeep",
.owner = THIS_MODULE,
.of_match_table = bbc_beep_match,
},
.probe = bbc_beep_probe, .probe = bbc_beep_probe,
.remove = __devexit_p(bbc_remove), .remove = __devexit_p(bbc_remove),
.shutdown = sparcspkr_shutdown, .shutdown = sparcspkr_shutdown,
@ -338,8 +341,11 @@ static const struct of_device_id grover_beep_match[] = {
}; };
static struct of_platform_driver grover_beep_driver = { static struct of_platform_driver grover_beep_driver = {
.name = "groverbeep", .driver = {
.match_table = grover_beep_match, .name = "groverbeep",
.owner = THIS_MODULE,
.of_match_table = grover_beep_match,
},
.probe = grover_beep_probe, .probe = grover_beep_probe,
.remove = __devexit_p(grover_remove), .remove = __devexit_p(grover_remove),
.shutdown = sparcspkr_shutdown, .shutdown = sparcspkr_shutdown,

View file

@ -51,7 +51,7 @@ static inline void i8042_write_command(int val)
static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_device_id *match) static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
dp = dp->child; dp = dp->child;
while (dp) { while (dp) {
@ -96,8 +96,11 @@ static const struct of_device_id sparc_i8042_match[] = {
MODULE_DEVICE_TABLE(of, sparc_i8042_match); MODULE_DEVICE_TABLE(of, sparc_i8042_match);
static struct of_platform_driver sparc_i8042_driver = { static struct of_platform_driver sparc_i8042_driver = {
.name = "i8042", .driver = {
.match_table = sparc_i8042_match, .name = "i8042",
.owner = THIS_MODULE,
.of_match_table = sparc_i8042_match,
},
.probe = sparc_i8042_probe, .probe = sparc_i8042_probe,
.remove = __devexit_p(sparc_i8042_remove), .remove = __devexit_p(sparc_i8042_remove),
}; };

View file

@ -244,17 +244,17 @@ static int __devinit xps2_of_probe(struct of_device *ofdev,
int error; int error;
dev_info(dev, "Device Tree Probing \'%s\'\n", dev_info(dev, "Device Tree Probing \'%s\'\n",
ofdev->node->name); ofdev->dev.of_node->name);
/* Get iospace for the device */ /* Get iospace for the device */
error = of_address_to_resource(ofdev->node, 0, &r_mem); error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
if (error) { if (error) {
dev_err(dev, "invalid address\n"); dev_err(dev, "invalid address\n");
return error; return error;
} }
/* Get IRQ for the device */ /* Get IRQ for the device */
if (of_irq_to_resource(ofdev->node, 0, &r_irq) == NO_IRQ) { if (of_irq_to_resource(ofdev->dev.of_node, 0, &r_irq) == NO_IRQ) {
dev_err(dev, "no IRQ found\n"); dev_err(dev, "no IRQ found\n");
return -ENODEV; return -ENODEV;
} }
@ -342,7 +342,7 @@ static int __devexit xps2_of_remove(struct of_device *of_dev)
iounmap(drvdata->base_address); iounmap(drvdata->base_address);
/* Get iospace of the device */ /* Get iospace of the device */
if (of_address_to_resource(of_dev->node, 0, &r_mem)) if (of_address_to_resource(of_dev->dev.of_node, 0, &r_mem))
dev_err(dev, "invalid address\n"); dev_err(dev, "invalid address\n");
else else
release_mem_region(r_mem.start, resource_size(&r_mem)); release_mem_region(r_mem.start, resource_size(&r_mem));
@ -362,8 +362,11 @@ static const struct of_device_id xps2_of_match[] __devinitconst = {
MODULE_DEVICE_TABLE(of, xps2_of_match); MODULE_DEVICE_TABLE(of, xps2_of_match);
static struct of_platform_driver xps2_of_driver = { static struct of_platform_driver xps2_of_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = xps2_of_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = xps2_of_match,
},
.probe = xps2_of_probe, .probe = xps2_of_probe,
.remove = __devexit_p(xps2_of_remove), .remove = __devexit_p(xps2_of_remove),
}; };

View file

@ -211,7 +211,7 @@ struct gpio_led_of_platform_data {
static int __devinit of_gpio_leds_probe(struct of_device *ofdev, static int __devinit of_gpio_leds_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *np = ofdev->node, *child; struct device_node *np = ofdev->dev.of_node, *child;
struct gpio_led_of_platform_data *pdata; struct gpio_led_of_platform_data *pdata;
int count = 0, ret; int count = 0, ret;
@ -291,8 +291,8 @@ static struct of_platform_driver of_gpio_leds_driver = {
.driver = { .driver = {
.name = "of_gpio_leds", .name = "of_gpio_leds",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_gpio_leds_match,
}, },
.match_table = of_gpio_leds_match,
.probe = of_gpio_leds_probe, .probe = of_gpio_leds_probe,
.remove = __devexit_p(of_gpio_leds_remove), .remove = __devexit_p(of_gpio_leds_remove),
}; };

View file

@ -39,14 +39,12 @@ static struct macio_chip *macio_on_hold;
static int macio_bus_match(struct device *dev, struct device_driver *drv) static int macio_bus_match(struct device *dev, struct device_driver *drv)
{ {
struct macio_dev * macio_dev = to_macio_device(dev); const struct of_device_id * matches = drv->of_match_table;
struct macio_driver * macio_drv = to_macio_driver(drv);
const struct of_device_id * matches = macio_drv->match_table;
if (!matches) if (!matches)
return 0; return 0;
return of_match_device(matches, &macio_dev->ofdev) != NULL; return of_match_device(matches, dev) != NULL;
} }
struct macio_dev *macio_dev_get(struct macio_dev *dev) struct macio_dev *macio_dev_get(struct macio_dev *dev)
@ -84,7 +82,7 @@ static int macio_device_probe(struct device *dev)
macio_dev_get(macio_dev); macio_dev_get(macio_dev);
match = of_match_device(drv->match_table, &macio_dev->ofdev); match = of_match_device(drv->driver.of_match_table, dev);
if (match) if (match)
error = drv->probe(macio_dev, match); error = drv->probe(macio_dev, match);
if (error) if (error)
@ -248,7 +246,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
static void macio_add_missing_resources(struct macio_dev *dev) static void macio_add_missing_resources(struct macio_dev *dev)
{ {
struct device_node *np = dev->ofdev.node; struct device_node *np = dev->ofdev.dev.of_node;
unsigned int irq_base; unsigned int irq_base;
/* Gatwick has some missing interrupts on child nodes */ /* Gatwick has some missing interrupts on child nodes */
@ -289,7 +287,7 @@ static void macio_add_missing_resources(struct macio_dev *dev)
static void macio_setup_interrupts(struct macio_dev *dev) static void macio_setup_interrupts(struct macio_dev *dev)
{ {
struct device_node *np = dev->ofdev.node; struct device_node *np = dev->ofdev.dev.of_node;
unsigned int irq; unsigned int irq;
int i = 0, j = 0; int i = 0, j = 0;
@ -317,7 +315,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
static void macio_setup_resources(struct macio_dev *dev, static void macio_setup_resources(struct macio_dev *dev,
struct resource *parent_res) struct resource *parent_res)
{ {
struct device_node *np = dev->ofdev.node; struct device_node *np = dev->ofdev.dev.of_node;
struct resource r; struct resource r;
int index; int index;
@ -373,9 +371,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
dev->bus = &chip->lbus; dev->bus = &chip->lbus;
dev->media_bay = in_bay; dev->media_bay = in_bay;
dev->ofdev.node = np; dev->ofdev.dev.of_node = np;
dev->ofdev.dma_mask = 0xffffffffUL; dev->ofdev.archdata.dma_mask = 0xffffffffUL;
dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask; dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
dev->ofdev.dev.parent = parent; dev->ofdev.dev.parent = parent;
dev->ofdev.dev.bus = &macio_bus_type; dev->ofdev.dev.bus = &macio_bus_type;
dev->ofdev.dev.release = macio_release_dev; dev->ofdev.dev.release = macio_release_dev;
@ -494,9 +492,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
} }
/* Add media bay devices if any */ /* Add media bay devices if any */
pnode = mbdev->ofdev.dev.of_node;
if (mbdev) if (mbdev)
for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
!= NULL;) {
if (macio_skip_device(np)) if (macio_skip_device(np))
continue; continue;
of_node_get(np); of_node_get(np);
@ -506,9 +504,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
} }
/* Add serial ports if any */ /* Add serial ports if any */
pnode = sdev->ofdev.dev.of_node;
if (sdev) { if (sdev) {
for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
!= NULL;) {
if (macio_skip_device(np)) if (macio_skip_device(np))
continue; continue;
of_node_get(np); of_node_get(np);

View file

@ -9,7 +9,7 @@ field##_show (struct device *dev, struct device_attribute *attr, \
char *buf) \ char *buf) \
{ \ { \
struct macio_dev *mdev = to_macio_device (dev); \ struct macio_dev *mdev = to_macio_device (dev); \
return sprintf (buf, format_string, mdev->ofdev.node->field); \ return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \
} }
static ssize_t static ssize_t
@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
int length = 0; int length = 0;
of = &to_macio_device (dev)->ofdev; of = &to_macio_device (dev)->ofdev;
compat = of_get_property(of->node, "compatible", &cplen); compat = of_get_property(of->dev.of_node, "compatible", &cplen);
if (!compat) { if (!compat) {
*buf = '\0'; *buf = '\0';
return 0; return 0;
@ -58,7 +58,7 @@ static ssize_t devspec_show(struct device *dev,
struct of_device *ofdev; struct of_device *ofdev;
ofdev = to_of_device(dev); ofdev = to_of_device(dev);
return sprintf(buf, "%s\n", ofdev->node->full_name); return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
} }
macio_config_of_attr (name, "%s\n"); macio_config_of_attr (name, "%s\n");

View file

@ -564,7 +564,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
unsigned long base; unsigned long base;
int i; int i;
ofnode = mdev->ofdev.node; ofnode = mdev->ofdev.dev.of_node;
if (macio_resource_count(mdev) < 1) if (macio_resource_count(mdev) < 1)
return -ENODEV; return -ENODEV;

View file

@ -375,7 +375,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
pr_debug("rackmeter_probe()\n"); pr_debug("rackmeter_probe()\n");
/* Get i2s-a node */ /* Get i2s-a node */
while ((i2s = of_get_next_child(mdev->ofdev.node, i2s)) != NULL) while ((i2s = of_get_next_child(mdev->ofdev.dev.of_node, i2s)) != NULL)
if (strcmp(i2s->name, "i2s-a") == 0) if (strcmp(i2s->name, "i2s-a") == 0)
break; break;
if (i2s == NULL) { if (i2s == NULL) {
@ -431,7 +431,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
of_address_to_resource(i2s, 1, &rdma)) { of_address_to_resource(i2s, 1, &rdma)) {
printk(KERN_ERR printk(KERN_ERR
"rackmeter: found match but lacks resources: %s", "rackmeter: found match but lacks resources: %s",
mdev->ofdev.node->full_name); mdev->ofdev.dev.of_node->full_name);
rc = -ENXIO; rc = -ENXIO;
goto bail_free; goto bail_free;
} }

View file

@ -671,8 +671,11 @@ static const struct of_device_id smu_platform_match[] =
static struct of_platform_driver smu_of_platform_driver = static struct of_platform_driver smu_of_platform_driver =
{ {
.name = "smu", .driver = {
.match_table = smu_platform_match, .name = "smu",
.owner = THIS_MODULE,
.of_match_table = smu_platform_match,
},
.probe = smu_platform_probe, .probe = smu_platform_probe,
}; };

View file

@ -2215,7 +2215,7 @@ static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match)
state = state_detached; state = state_detached;
/* Lookup the fans in the device tree */ /* Lookup the fans in the device tree */
fcu_lookup_fans(dev->node); fcu_lookup_fans(dev->dev.of_node);
/* Add the driver */ /* Add the driver */
return i2c_add_driver(&therm_pm72_driver); return i2c_add_driver(&therm_pm72_driver);
@ -2238,8 +2238,11 @@ static const struct of_device_id fcu_match[] =
static struct of_platform_driver fcu_of_platform_driver = static struct of_platform_driver fcu_of_platform_driver =
{ {
.name = "temperature", .driver = {
.match_table = fcu_match, .name = "temperature",
.owner = THIS_MODULE,
.of_match_table = fcu_match,
},
.probe = fcu_of_probe, .probe = fcu_of_probe,
.remove = fcu_of_remove .remove = fcu_of_remove
}; };

View file

@ -463,8 +463,11 @@ static const struct of_device_id therm_of_match[] = {{
}; };
static struct of_platform_driver therm_of_driver = { static struct of_platform_driver therm_of_driver = {
.name = "temperature", .driver = {
.match_table = therm_of_match, .name = "temperature",
.owner = THIS_MODULE,
.of_match_table = therm_of_match,
},
.probe = therm_of_probe, .probe = therm_of_probe,
.remove = therm_of_remove, .remove = therm_of_remove,
}; };

View file

@ -64,7 +64,7 @@ static int of_mmc_spi_get_ro(struct device *dev)
struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
{ {
struct device *dev = &spi->dev; struct device *dev = &spi->dev;
struct device_node *np = dev_archdata_get_node(&dev->archdata); struct device_node *np = dev->of_node;
struct of_mmc_spi *oms; struct of_mmc_spi *oms;
const u32 *voltage_ranges; const u32 *voltage_ranges;
int num_ranges; int num_ranges;
@ -135,7 +135,7 @@ EXPORT_SYMBOL(mmc_spi_get_pdata);
void mmc_spi_put_pdata(struct spi_device *spi) void mmc_spi_put_pdata(struct spi_device *spi)
{ {
struct device *dev = &spi->dev; struct device *dev = &spi->dev;
struct device_node *np = dev_archdata_get_node(&dev->archdata); struct device_node *np = dev->of_node;
struct of_mmc_spi *oms = to_of_mmc_spi(dev); struct of_mmc_spi *oms = to_of_mmc_spi(dev);
int i; int i;

View file

@ -118,7 +118,7 @@ static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
static int __devinit sdhci_of_probe(struct of_device *ofdev, static int __devinit sdhci_of_probe(struct of_device *ofdev,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *np = ofdev->node; struct device_node *np = ofdev->dev.of_node;
struct sdhci_of_data *sdhci_of_data = match->data; struct sdhci_of_data *sdhci_of_data = match->data;
struct sdhci_host *host; struct sdhci_host *host;
struct sdhci_of_host *of_host; struct sdhci_of_host *of_host;
@ -205,8 +205,11 @@ static const struct of_device_id sdhci_of_match[] = {
MODULE_DEVICE_TABLE(of, sdhci_of_match); MODULE_DEVICE_TABLE(of, sdhci_of_match);
static struct of_platform_driver sdhci_of_driver = { static struct of_platform_driver sdhci_of_driver = {
.driver.name = "sdhci-of", .driver = {
.match_table = sdhci_of_match, .name = "sdhci-of",
.owner = THIS_MODULE,
.of_match_table = sdhci_of_match,
},
.probe = sdhci_of_probe, .probe = sdhci_of_probe,
.remove = __devexit_p(sdhci_of_remove), .remove = __devexit_p(sdhci_of_remove),
.suspend = sdhci_of_suspend, .suspend = sdhci_of_suspend,

View file

@ -143,7 +143,7 @@ static int of_flash_remove(struct of_device *dev)
static struct mtd_info * __devinit obsolete_probe(struct of_device *dev, static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
struct map_info *map) struct map_info *map)
{ {
struct device_node *dp = dev->node; struct device_node *dp = dev->dev.of_node;
const char *of_probe; const char *of_probe;
struct mtd_info *mtd; struct mtd_info *mtd;
static const char *rom_probe_types[] static const char *rom_probe_types[]
@ -221,7 +221,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
#ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_PARTITIONS
const char **part_probe_types; const char **part_probe_types;
#endif #endif
struct device_node *dp = dev->node; struct device_node *dp = dev->dev.of_node;
struct resource res; struct resource res;
struct of_flash *info; struct of_flash *info;
const char *probe_type = match->data; const char *probe_type = match->data;
@ -245,7 +245,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
p = of_get_property(dp, "reg", &count); p = of_get_property(dp, "reg", &count);
if (count % reg_tuple_size != 0) { if (count % reg_tuple_size != 0) {
dev_err(&dev->dev, "Malformed reg property on %s\n", dev_err(&dev->dev, "Malformed reg property on %s\n",
dev->node->full_name); dev->dev.of_node->full_name);
err = -EINVAL; err = -EINVAL;
goto err_flash_remove; goto err_flash_remove;
} }
@ -418,8 +418,11 @@ static struct of_device_id of_flash_match[] = {
MODULE_DEVICE_TABLE(of, of_flash_match); MODULE_DEVICE_TABLE(of, of_flash_match);
static struct of_platform_driver of_flash_driver = { static struct of_platform_driver of_flash_driver = {
.name = "of-flash", .driver = {
.match_table = of_flash_match, .name = "of-flash",
.owner = THIS_MODULE,
.of_match_table = of_flash_match,
},
.probe = of_flash_probe, .probe = of_flash_probe,
.remove = of_flash_remove, .remove = of_flash_remove,
}; };

View file

@ -110,7 +110,7 @@ int uflash_devinit(struct of_device *op, struct device_node *dp)
static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match) static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->dev.of_node;
/* Flashprom must have the "user" property in order to /* Flashprom must have the "user" property in order to
* be used by this driver. * be used by this driver.
@ -149,8 +149,11 @@ static const struct of_device_id uflash_match[] = {
MODULE_DEVICE_TABLE(of, uflash_match); MODULE_DEVICE_TABLE(of, uflash_match);
static struct of_platform_driver uflash_driver = { static struct of_platform_driver uflash_driver = {
.name = DRIVER_NAME, .driver = {
.match_table = uflash_match, .name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = uflash_match,
},
.probe = uflash_probe, .probe = uflash_probe,
.remove = __devexit_p(uflash_remove), .remove = __devexit_p(uflash_remove),
}; };

View file

@ -1030,14 +1030,14 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev,
init_waitqueue_head(&ctrl->controller.wq); init_waitqueue_head(&ctrl->controller.wq);
init_waitqueue_head(&ctrl->irq_wait); init_waitqueue_head(&ctrl->irq_wait);
ctrl->regs = of_iomap(ofdev->node, 0); ctrl->regs = of_iomap(ofdev->dev.of_node, 0);
if (!ctrl->regs) { if (!ctrl->regs) {
dev_err(&ofdev->dev, "failed to get memory region\n"); dev_err(&ofdev->dev, "failed to get memory region\n");
ret = -ENODEV; ret = -ENODEV;
goto err; goto err;
} }
ctrl->irq = of_irq_to_resource(ofdev->node, 0, NULL); ctrl->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
if (ctrl->irq == NO_IRQ) { if (ctrl->irq == NO_IRQ) {
dev_err(&ofdev->dev, "failed to get irq resource\n"); dev_err(&ofdev->dev, "failed to get irq resource\n");
ret = -ENODEV; ret = -ENODEV;
@ -1058,7 +1058,7 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev,
goto err; goto err;
} }
for_each_child_of_node(ofdev->node, child) for_each_child_of_node(ofdev->dev.of_node, child)
if (of_device_is_compatible(child, "fsl,elbc-fcm-nand")) if (of_device_is_compatible(child, "fsl,elbc-fcm-nand"))
fsl_elbc_chip_probe(ctrl, child); fsl_elbc_chip_probe(ctrl, child);
@ -1078,9 +1078,10 @@ static const struct of_device_id fsl_elbc_match[] = {
static struct of_platform_driver fsl_elbc_ctrl_driver = { static struct of_platform_driver fsl_elbc_ctrl_driver = {
.driver = { .driver = {
.name = "fsl-elbc", .name = "fsl-elbc",
.owner = THIS_MODULE,
.of_match_table = fsl_elbc_match,
}, },
.match_table = fsl_elbc_match,
.probe = fsl_elbc_ctrl_probe, .probe = fsl_elbc_ctrl_probe,
.remove = fsl_elbc_ctrl_remove, .remove = fsl_elbc_ctrl_remove,
}; };

Some files were not shown because too many files have changed in this diff Show more