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

Configure Feed

Select the types of activity you want to include in your feed.

video: fbdev: simplify getting .drvdata

We should get drvdata 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>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Wolfram Sang and committed by
Bartlomiej Zolnierkiewicz
b2faabc8 c8b54776

+8 -16
+4 -8
drivers/video/fbdev/auo_k190x.c
··· 776 776 */ 777 777 static int __maybe_unused auok190x_runtime_suspend(struct device *dev) 778 778 { 779 - struct platform_device *pdev = to_platform_device(dev); 780 - struct fb_info *info = platform_get_drvdata(pdev); 779 + struct fb_info *info = dev_get_drvdata(dev); 781 780 struct auok190xfb_par *par = info->par; 782 781 struct auok190x_board *board = par->board; 783 782 u16 standby_param; ··· 822 823 823 824 static int __maybe_unused auok190x_runtime_resume(struct device *dev) 824 825 { 825 - struct platform_device *pdev = to_platform_device(dev); 826 - struct fb_info *info = platform_get_drvdata(pdev); 826 + struct fb_info *info = dev_get_drvdata(dev); 827 827 struct auok190xfb_par *par = info->par; 828 828 struct auok190x_board *board = par->board; 829 829 ··· 855 857 856 858 static int __maybe_unused auok190x_suspend(struct device *dev) 857 859 { 858 - struct platform_device *pdev = to_platform_device(dev); 859 - struct fb_info *info = platform_get_drvdata(pdev); 860 + struct fb_info *info = dev_get_drvdata(dev); 860 861 struct auok190xfb_par *par = info->par; 861 862 struct auok190x_board *board = par->board; 862 863 int ret; ··· 894 897 895 898 static int __maybe_unused auok190x_resume(struct device *dev) 896 899 { 897 - struct platform_device *pdev = to_platform_device(dev); 898 - struct fb_info *info = platform_get_drvdata(pdev); 900 + struct fb_info *info = dev_get_drvdata(dev); 899 901 struct auok190xfb_par *par = info->par; 900 902 struct auok190x_board *board = par->board; 901 903
+2 -4
drivers/video/fbdev/sh_mobile_lcdcfb.c
··· 2354 2354 2355 2355 static int sh_mobile_lcdc_runtime_suspend(struct device *dev) 2356 2356 { 2357 - struct platform_device *pdev = to_platform_device(dev); 2358 - struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); 2357 + struct sh_mobile_lcdc_priv *priv = dev_get_drvdata(dev); 2359 2358 2360 2359 /* turn off LCDC hardware */ 2361 2360 lcdc_write(priv, _LDCNT1R, 0); ··· 2364 2365 2365 2366 static int sh_mobile_lcdc_runtime_resume(struct device *dev) 2366 2367 { 2367 - struct platform_device *pdev = to_platform_device(dev); 2368 - struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); 2368 + struct sh_mobile_lcdc_priv *priv = dev_get_drvdata(dev); 2369 2369 2370 2370 __sh_mobile_lcdc_start(priv); 2371 2371
+2 -4
drivers/video/fbdev/sh_mobile_meram.c
··· 572 572 #ifdef CONFIG_PM 573 573 static int sh_mobile_meram_suspend(struct device *dev) 574 574 { 575 - struct platform_device *pdev = to_platform_device(dev); 576 - struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev); 575 + struct sh_mobile_meram_priv *priv = dev_get_drvdata(dev); 577 576 unsigned int i, j; 578 577 579 578 for (i = 0; i < MERAM_REGS_SIZE; i++) ··· 595 596 596 597 static int sh_mobile_meram_resume(struct device *dev) 597 598 { 598 - struct platform_device *pdev = to_platform_device(dev); 599 - struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev); 599 + struct sh_mobile_meram_priv *priv = dev_get_drvdata(dev); 600 600 unsigned int i, j; 601 601 602 602 for (i = 0; i < 32; i++) {