Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296033
b: refs/heads/master
c: d2524ca
h: refs/heads/master
i:
  296031: f3cbdc0
v: v3
  • Loading branch information
Heiko Stuebner authored and Kukjin Kim committed Feb 6, 2012
1 parent 85c1a12 commit 7cb866f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a51da0444ce720ae496ac3a85f8609a37e43c4f5
refs/heads/master: d2524caac3e14af0b95bb428084e0ef355514c2f
31 changes: 22 additions & 9 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,20 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
return 0;
}

static const struct of_device_id s3c_rtc_dt_match[];

static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
{
#ifdef CONFIG_OF
if (pdev->dev.of_node) {
const struct of_device_id *match;
match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
return match->data;
}
#endif
return platform_get_device_id(pdev)->driver_data;
}

static int __devinit s3c_rtc_probe(struct platform_device *pdev)
{
struct rtc_device *rtc;
Expand Down Expand Up @@ -508,13 +522,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
goto err_nortc;
}

#ifdef CONFIG_OF
if (pdev->dev.of_node)
s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
"samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
else
#endif
s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
s3c_rtc_cpu_type = s3c_rtc_get_driver_data(pdev);

/* Check RTC Time */

Expand Down Expand Up @@ -638,8 +646,13 @@ static int s3c_rtc_resume(struct platform_device *pdev)

#ifdef CONFIG_OF
static const struct of_device_id s3c_rtc_dt_match[] = {
{ .compatible = "samsung,s3c2410-rtc" },
{ .compatible = "samsung,s3c6410-rtc" },
{
.compatible = "samsung,s3c2410-rtc"
.data = TYPE_S3C2410,
}, {
.compatible = "samsung,s3c6410-rtc"
.data = TYPE_S3C64XX,
},
{},
};
MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
Expand Down

0 comments on commit 7cb866f

Please sign in to comment.