Skip to content

Commit c607a0d

Browse files
Jingoo Handavem330
authored andcommitted
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: Jingoo Han <jg1.han@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 09a2748 commit c607a0d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • drivers/net/ethernet/cadence

‎drivers/net/ethernet/cadence/macb.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void macb_get_hwaddr(struct macb *bp)
125125
u8 addr[6];
126126
int i;
127127

128-
pdata = bp->pdev->dev.platform_data;
128+
pdata = dev_get_platdata(&bp->pdev->dev);
129129

130130
/* Check all 4 address register for vaild address */
131131
for (i = 0; i < 4; i++) {
@@ -335,7 +335,7 @@ int macb_mii_init(struct macb *bp)
335335
bp->pdev->name, bp->pdev->id);
336336
bp->mii_bus->priv = bp;
337337
bp->mii_bus->parent = &bp->dev->dev;
338-
pdata = bp->pdev->dev.platform_data;
338+
pdata = dev_get_platdata(&bp->pdev->dev);
339339

340340
bp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
341341
if (!bp->mii_bus->irq) {
@@ -1851,7 +1851,7 @@ static int __init macb_probe(struct platform_device *pdev)
18511851

18521852
err = of_get_phy_mode(pdev->dev.of_node);
18531853
if (err < 0) {
1854-
pdata = pdev->dev.platform_data;
1854+
pdata = dev_get_platdata(&pdev->dev);
18551855
if (pdata && pdata->is_rmii)
18561856
bp->phy_interface = PHY_INTERFACE_MODE_RMII;
18571857
else

0 commit comments

Comments
 (0)