Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp: ptp_dte: simplify getting .driver_data

We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wolfram Sang and committed by
David S. Miller
c0bfdae0 00f17a82

+2 -4
+2 -4
drivers/ptp/ptp_dte.c
··· 288 288 #ifdef CONFIG_PM_SLEEP 289 289 static int ptp_dte_suspend(struct device *dev) 290 290 { 291 - struct platform_device *pdev = to_platform_device(dev); 292 - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); 291 + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); 293 292 u8 i; 294 293 295 294 for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) { ··· 304 305 305 306 static int ptp_dte_resume(struct device *dev) 306 307 { 307 - struct platform_device *pdev = to_platform_device(dev); 308 - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); 308 + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); 309 309 u8 i; 310 310 311 311 for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) {