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

drivers/rtc/rtc-m48t86.c: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jingoo Han and committed by
Linus Torvalds
b5f0902d 8136032b

+4 -4
+4 -4
drivers/rtc/rtc-m48t86.c
··· 46 46 { 47 47 unsigned char reg; 48 48 struct platform_device *pdev = to_platform_device(dev); 49 - struct m48t86_ops *ops = pdev->dev.platform_data; 49 + struct m48t86_ops *ops = dev_get_platdata(&pdev->dev); 50 50 51 51 reg = ops->readbyte(M48T86_REG_B); 52 52 ··· 84 84 { 85 85 unsigned char reg; 86 86 struct platform_device *pdev = to_platform_device(dev); 87 - struct m48t86_ops *ops = pdev->dev.platform_data; 87 + struct m48t86_ops *ops = dev_get_platdata(&pdev->dev); 88 88 89 89 reg = ops->readbyte(M48T86_REG_B); 90 90 ··· 123 123 { 124 124 unsigned char reg; 125 125 struct platform_device *pdev = to_platform_device(dev); 126 - struct m48t86_ops *ops = pdev->dev.platform_data; 126 + struct m48t86_ops *ops = dev_get_platdata(&pdev->dev); 127 127 128 128 reg = ops->readbyte(M48T86_REG_B); 129 129 ··· 147 147 static int m48t86_rtc_probe(struct platform_device *dev) 148 148 { 149 149 unsigned char reg; 150 - struct m48t86_ops *ops = dev->dev.platform_data; 150 + struct m48t86_ops *ops = dev_get_platdata(&dev->dev); 151 151 struct rtc_device *rtc; 152 152 153 153 rtc = devm_rtc_device_register(&dev->dev, "m48t86",