static void __iomem *wsp_h8_getaddr(void) { struct device_node *aliases; struct device_node *uart; struct property *path; void __iomem *va = NULL; /* * there is nothing in the devtree to tell us which is mapped * to the H8, but se know it is the second serial port. */ aliases = of_find_node_by_path("/aliases"); if (aliases == NULL) return NULL; path = of_find_property(aliases, "serial1", NULL); if (path == NULL) goto out; uart = of_find_node_by_path(path->value); if (uart == NULL) goto out; va = of_iomap(uart, 0); /* remove it so no one messes with it */ of_detach_node(uart); of_node_put(uart); out: of_node_put(aliases); return va; }
static void __iomem *wsp_h8_getaddr(void) { struct device_node *aliases; struct device_node *uart; struct property *path; void __iomem *va = NULL; /* */ aliases = of_find_node_by_path("/aliases"); if (aliases == NULL) return NULL; path = of_find_property(aliases, "serial1", NULL); if (path == NULL) goto out; uart = of_find_node_by_path(path->value); if (uart == NULL) goto out; va = of_iomap(uart, 0); /* */ of_detach_node(uart); of_node_put(uart); out: of_node_put(aliases); return va; }
int dlpar_detach_node(struct device_node *dn) { int rc; rc = of_detach_node(dn); if (rc) return rc; of_node_put(dn); /* Must decrement the refcount */ return 0; }
int dlpar_detach_node(struct device_node *dn) { struct device_node *child; int rc; child = of_get_next_child(dn, NULL); while (child) { dlpar_detach_node(child); child = of_get_next_child(dn, child); } rc = of_detach_node(dn); if (rc) return rc; return 0; }
int dlpar_detach_node(struct device_node *dn) { struct device_node *child; int rc; child = of_get_next_child(dn, NULL); while (child) { dlpar_detach_node(child); child = of_get_next_child(dn, child); } rc = of_detach_node(dn); if (rc) return rc; of_node_put(dn); /* Must decrement the refcount */ return 0; }
int dlpar_detach_node(struct device_node *dn) { #ifdef CONFIG_PROC_DEVICETREE struct device_node *parent = dn->parent; struct property *prop = dn->properties; while (prop) { remove_proc_entry(prop->name, dn->pde); prop = prop->next; } if (dn->pde) remove_proc_entry(dn->pde->name, parent->pde); #endif pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); of_detach_node(dn); of_node_put(dn); /* Must decrement the refcount */ return 0; }
static void __init mpc885ads_setup_arch(void) { struct device_node *np; cpm_reset(); init_ioports(); np = of_find_compatible_node(NULL, NULL, "fsl,mpc885ads-bcsr"); if (!np) { printk(KERN_CRIT "Could not find fsl,mpc885ads-bcsr node\n"); return; } bcsr = of_iomap(np, 0); bcsr5 = of_iomap(np, 1); of_node_put(np); if (!bcsr || !bcsr5) { printk(KERN_CRIT "Could not remap BCSR\n"); return; } clrbits32(&bcsr[1], BCSR1_RS232EN_1); #ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2 setbits32(&bcsr[1], BCSR1_RS232EN_2); #else clrbits32(&bcsr[1], BCSR1_RS232EN_2); #endif clrbits32(bcsr5, BCSR5_MII1_EN); setbits32(bcsr5, BCSR5_MII1_RST); udelay(1000); clrbits32(bcsr5, BCSR5_MII1_RST); #ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2 clrbits32(bcsr5, BCSR5_MII2_EN); setbits32(bcsr5, BCSR5_MII2_RST); udelay(1000); clrbits32(bcsr5, BCSR5_MII2_RST); #else setbits32(bcsr5, BCSR5_MII2_EN); #endif #ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3 clrbits32(&bcsr[4], BCSR4_ETH10_RST); udelay(1000); setbits32(&bcsr[4], BCSR4_ETH10_RST); setbits32(&bcsr[1], BCSR1_ETHEN); np = of_find_node_by_path("/soc@ff000000/cpm@9c0/serial@a80"); #else np = of_find_node_by_path("/soc@ff000000/cpm@9c0/ethernet@a40"); #endif /* The SCC3 enet registers overlap the SMC1 registers, so * one of the two must be removed from the device tree. */ if (np) { of_detach_node(np); of_node_put(np); } }