Commit c607a0d9 authored by Jingoo Han's avatar Jingoo Han Committed by David S. Miller

net: macb: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09a27480
...@@ -125,7 +125,7 @@ void macb_get_hwaddr(struct macb *bp) ...@@ -125,7 +125,7 @@ void macb_get_hwaddr(struct macb *bp)
u8 addr[6]; u8 addr[6];
int i; int i;
pdata = bp->pdev->dev.platform_data; pdata = dev_get_platdata(&bp->pdev->dev);
/* Check all 4 address register for vaild address */ /* Check all 4 address register for vaild address */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -335,7 +335,7 @@ int macb_mii_init(struct macb *bp) ...@@ -335,7 +335,7 @@ int macb_mii_init(struct macb *bp)
bp->pdev->name, bp->pdev->id); bp->pdev->name, bp->pdev->id);
bp->mii_bus->priv = bp; bp->mii_bus->priv = bp;
bp->mii_bus->parent = &bp->dev->dev; bp->mii_bus->parent = &bp->dev->dev;
pdata = bp->pdev->dev.platform_data; pdata = dev_get_platdata(&bp->pdev->dev);
bp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); bp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
if (!bp->mii_bus->irq) { if (!bp->mii_bus->irq) {
...@@ -1851,7 +1851,7 @@ static int __init macb_probe(struct platform_device *pdev) ...@@ -1851,7 +1851,7 @@ static int __init macb_probe(struct platform_device *pdev)
err = of_get_phy_mode(pdev->dev.of_node); err = of_get_phy_mode(pdev->dev.of_node);
if (err < 0) { if (err < 0) {
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
if (pdata && pdata->is_rmii) if (pdata && pdata->is_rmii)
bp->phy_interface = PHY_INTERFACE_MODE_RMII; bp->phy_interface = PHY_INTERFACE_MODE_RMII;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment