of: Always use 'struct device.of_node' to get device node pointer.

The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated.  This patch
makes all readers of these elements use device.of_node instead.

(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Grant Likely
2010-04-13 16:12:29 -07:00
parent d12d42f744
commit 61c7a080a5
157 changed files with 497 additions and 488 deletions
+4 -4
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;
@@ -76,17 +76,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;
+2 -2
View File
@@ -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)
+1 -1
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
+2 -2
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)
+4 -4
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;
@@ -96,17 +96,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;
+8 -8
View File
@@ -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;
+2 -2
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;
@@ -329,7 +329,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;
+8 -8
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;
@@ -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;
+3 -3
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;
+1 -1
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;
+1 -1
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;
+1 -1
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;
+3 -3
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;
+4 -4
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");
+7 -7
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);
+1 -1
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;
+15 -15
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)
+1 -1
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) {
+1 -1
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;

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