提交 b5ebf078 编写于 作者: J Jingoo Han 提交者: Linus Torvalds

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: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b7efdf3b
...@@ -251,14 +251,15 @@ static SIMPLE_DEV_PM_OPS(pm80x_rtc_pm_ops, pm80x_rtc_suspend, pm80x_rtc_resume); ...@@ -251,14 +251,15 @@ static SIMPLE_DEV_PM_OPS(pm80x_rtc_pm_ops, pm80x_rtc_suspend, pm80x_rtc_resume);
static int pm80x_rtc_probe(struct platform_device *pdev) static int pm80x_rtc_probe(struct platform_device *pdev)
{ {
struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct pm80x_platform_data *pm80x_pdata; struct pm80x_platform_data *pm80x_pdata =
dev_get_platdata(pdev->dev.parent);
struct pm80x_rtc_pdata *pdata = NULL; struct pm80x_rtc_pdata *pdata = NULL;
struct pm80x_rtc_info *info; struct pm80x_rtc_info *info;
struct rtc_time tm; struct rtc_time tm;
unsigned long ticks = 0; unsigned long ticks = 0;
int ret; int ret;
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
if (pdata == NULL) if (pdata == NULL)
dev_warn(&pdev->dev, "No platform data!\n"); dev_warn(&pdev->dev, "No platform data!\n");
...@@ -326,8 +327,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev) ...@@ -326,8 +327,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
regmap_update_bits(info->map, PM800_RTC_CONTROL, PM800_RTC1_USE_XO, regmap_update_bits(info->map, PM800_RTC_CONTROL, PM800_RTC1_USE_XO,
PM800_RTC1_USE_XO); PM800_RTC1_USE_XO);
if (pdev->dev.parent->platform_data) { if (pm80x_pdata) {
pm80x_pdata = pdev->dev.parent->platform_data;
pdata = pm80x_pdata->rtc; pdata = pm80x_pdata->rtc;
if (pdata) if (pdata)
info->rtc_dev->dev.platform_data = &pdata->rtc_wakeup; info->rtc_dev->dev.platform_data = &pdata->rtc_wakeup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册