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

drivers/rtc/rtc-88pm80x.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
b5ebf078 b7efdf3b

+4 -4
+4 -4
drivers/rtc/rtc-88pm80x.c
··· 251 251 static int pm80x_rtc_probe(struct platform_device *pdev) 252 252 { 253 253 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); 254 - struct pm80x_platform_data *pm80x_pdata; 254 + struct pm80x_platform_data *pm80x_pdata = 255 + dev_get_platdata(pdev->dev.parent); 255 256 struct pm80x_rtc_pdata *pdata = NULL; 256 257 struct pm80x_rtc_info *info; 257 258 struct rtc_time tm; 258 259 unsigned long ticks = 0; 259 260 int ret; 260 261 261 - pdata = pdev->dev.platform_data; 262 + pdata = dev_get_platdata(&pdev->dev); 262 263 if (pdata == NULL) 263 264 dev_warn(&pdev->dev, "No platform data!\n"); 264 265 ··· 327 326 regmap_update_bits(info->map, PM800_RTC_CONTROL, PM800_RTC1_USE_XO, 328 327 PM800_RTC1_USE_XO); 329 328 330 - if (pdev->dev.parent->platform_data) { 331 - pm80x_pdata = pdev->dev.parent->platform_data; 329 + if (pm80x_pdata) { 332 330 pdata = pm80x_pdata->rtc; 333 331 if (pdata) 334 332 info->rtc_dev->dev.platform_data = &pdata->rtc_wakeup;