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:
@@ -1090,7 +1090,7 @@ static void xemaclite_remove_ndev(struct net_device *ndev)
|
||||
*/
|
||||
static bool get_bool(struct of_device *ofdev, const char *s)
|
||||
{
|
||||
u32 *p = (u32 *)of_get_property(ofdev->node, s, NULL);
|
||||
u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL);
|
||||
|
||||
if (p) {
|
||||
return (bool)*p;
|
||||
@@ -1132,14 +1132,14 @@ static int __devinit xemaclite_of_probe(struct of_device *ofdev,
|
||||
dev_info(dev, "Device Tree Probing\n");
|
||||
|
||||
/* Get iospace for the device */
|
||||
rc = of_address_to_resource(ofdev->node, 0, &r_mem);
|
||||
rc = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
|
||||
if (rc) {
|
||||
dev_err(dev, "invalid address\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Get IRQ for the device */
|
||||
rc = of_irq_to_resource(ofdev->node, 0, &r_irq);
|
||||
rc = of_irq_to_resource(ofdev->dev.of_node, 0, &r_irq);
|
||||
if (rc == NO_IRQ) {
|
||||
dev_err(dev, "no IRQ found\n");
|
||||
return rc;
|
||||
@@ -1184,7 +1184,7 @@ static int __devinit xemaclite_of_probe(struct of_device *ofdev,
|
||||
lp->next_rx_buf_to_use = 0x0;
|
||||
lp->tx_ping_pong = get_bool(ofdev, "xlnx,tx-ping-pong");
|
||||
lp->rx_ping_pong = get_bool(ofdev, "xlnx,rx-ping-pong");
|
||||
mac_address = of_get_mac_address(ofdev->node);
|
||||
mac_address = of_get_mac_address(ofdev->dev.of_node);
|
||||
|
||||
if (mac_address)
|
||||
/* Set the MAC address. */
|
||||
@@ -1199,7 +1199,7 @@ static int __devinit xemaclite_of_probe(struct of_device *ofdev,
|
||||
/* Set the MAC address in the EmacLite device */
|
||||
xemaclite_update_address(lp, ndev->dev_addr);
|
||||
|
||||
lp->phy_node = of_parse_phandle(ofdev->node, "phy-handle", 0);
|
||||
lp->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0);
|
||||
rc = xemaclite_mdio_setup(lp, &ofdev->dev);
|
||||
if (rc)
|
||||
dev_warn(&ofdev->dev, "error registering MDIO bus\n");
|
||||
|
Reference in New Issue
Block a user