Skip to contentSkip to conversation

net: use platform_{get,set}_drvdata()

PATCH Superseded Libo Chen 3 participants 6 messages Aug 15, 2013 – Aug 16, 2013

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Libo Chen

author
#0 lore raw

v3 cover net: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Libo Chen (7):
net: fsl_pq_mdio: use platform_{get,set}_drvdata()
net: ucc_geth: use platform_{get,set}_drvdata()
net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
net: sunbmac: use platform_{get,set}_drvdata()
net: sunhme: use platform_{get,set}_drvdata()
net: xilinx_emaclite: use platform_{get,set}_drvdata()
net: davinci_mdio: use platform_{get,set}_drvdata()

 drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |    3 +--
 drivers/net/ethernet/freescale/fsl_pq_mdio.c     |    2 +-
 drivers/net/ethernet/freescale/ucc_geth.c        |    3 +--
 drivers/net/ethernet/sun/sunbmac.c               |    2 +-
 drivers/net/ethernet/sun/sunhme.c                |    6 +++---
 drivers/net/ethernet/ti/davinci_mdio.c           |    3 +--
 drivers/net/ethernet/xilinx/xilinx_emaclite.c    |    3 +--
 7 files changed, 9 insertions(+), 13 deletions(-)
maintainer
#1 lore raw

From: Libo Chen <[email protected]>
Date: Thu, 15 Aug 2013 21:01:17 +0800

Quoted 8 lines

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Series applied.

maintainer
#2 lore raw

From: David Miller <[email protected]>
Date: Thu, 15 Aug 2013 15:23:59 -0700 (PDT)

Quoted 7 lines

From: Libo Chen <[email protected]>
Date: Thu, 15 Aug 2013 21:01:17 +0800

Quoted 4 lines

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

Quoted 6 lines
Quoted 4 lines

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Series applied.

Actually, I had to revert, these patches break the build.

drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’:
drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’:
drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default]

#3 lore raw

Hello.

Quoted 14 lines · David Miller
Quoted 7 lines

From: Libo Chen <[email protected]>
Date: Thu, 15 Aug 2013 21:01:17 +0800

Quoted 3 lines

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

Quoted 6 lines
Quoted 4 lines

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Series applied.

Quoted 7 lines

Actually, I had to revert, these patches break the build.

drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’:
drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’:
drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default]

Hm, patch #5 was clearly defective as it tried to call
platform_{get|set}_drvdata() on PCI devices -- I've read the patch but overlooked that. And the driver lacks #include <linux/platform_device.h>, so I'm not sure it always compiled flawlessly.

WBR, Sergei

#4 lore raw
Quoted 25 lines · Sergei Shtylyov
Quoted 16 lines
Quoted 7 lines

From: Libo Chen <[email protected]>
Date: Thu, 15 Aug 2013 21:01:17 +0800

Quoted 3 lines

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

Quoted 6 lines
Quoted 4 lines

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Series applied.

Actually, I had to revert, these patches break the build.

Quoted 8 lines

drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’:
drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’:
drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default]

Quoted 4 lines

Hm, patch #5 was clearly defective as it tried to call
platform_{get|set}_drvdata() on PCI devices -- I've read the patch but overlooked that. And the driver lacks #include <linux/platform_device.h>, so I'm not sure it always compiled flawlessly.

Ah, the platform code is protected by #ifdef CONFIG_SBUS... probably some
header #include's <linux/platform_device.h>?

WBR, Sergei

author
#5 lore raw
In reply to David Miller
Quoted 17 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 15 Aug 2013 15:23:59 -0700 (PDT)

Quoted 7 lines

From: Libo Chen <[email protected]>
Date: Thu, 15 Aug 2013 21:01:17 +0800

Quoted 4 lines

Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.

Quoted 6 lines
Quoted 4 lines

changelog v3:
remove modify about dev_set_drvdata()
changelog v2:
this version add modify record about dev_set_drvdata().

Series applied.

Quoted 8 lines

Actually, I had to revert, these patches break the build.

drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’:
drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’:
drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default]

oh, it is my fault, I will update!