diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/rtc/rtc-m48t35.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/rtc/rtc-m48t35.c')
-rw-r--r-- | drivers/rtc/rtc-m48t35.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c index 0b2197559940..7410875e5838 100644 --- a/drivers/rtc/rtc-m48t35.c +++ b/drivers/rtc/rtc-m48t35.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/rtc.h> | 18 | #include <linux/rtc.h> |
19 | #include <linux/slab.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/bcd.h> | 21 | #include <linux/bcd.h> |
21 | #include <linux/io.h> | 22 | #include <linux/io.h> |
@@ -142,7 +143,6 @@ static const struct rtc_class_ops m48t35_ops = { | |||
142 | 143 | ||
143 | static int __devinit m48t35_probe(struct platform_device *pdev) | 144 | static int __devinit m48t35_probe(struct platform_device *pdev) |
144 | { | 145 | { |
145 | struct rtc_device *rtc; | ||
146 | struct resource *res; | 146 | struct resource *res; |
147 | struct m48t35_priv *priv; | 147 | struct m48t35_priv *priv; |
148 | int ret = 0; | 148 | int ret = 0; |
@@ -171,20 +171,21 @@ static int __devinit m48t35_probe(struct platform_device *pdev) | |||
171 | ret = -ENOMEM; | 171 | ret = -ENOMEM; |
172 | goto out; | 172 | goto out; |
173 | } | 173 | } |
174 | |||
174 | spin_lock_init(&priv->lock); | 175 | spin_lock_init(&priv->lock); |
175 | rtc = rtc_device_register("m48t35", &pdev->dev, | 176 | |
177 | platform_set_drvdata(pdev, priv); | ||
178 | |||
179 | priv->rtc = rtc_device_register("m48t35", &pdev->dev, | ||
176 | &m48t35_ops, THIS_MODULE); | 180 | &m48t35_ops, THIS_MODULE); |
177 | if (IS_ERR(rtc)) { | 181 | if (IS_ERR(priv->rtc)) { |
178 | ret = PTR_ERR(rtc); | 182 | ret = PTR_ERR(priv->rtc); |
179 | goto out; | 183 | goto out; |
180 | } | 184 | } |
181 | priv->rtc = rtc; | 185 | |
182 | platform_set_drvdata(pdev, priv); | ||
183 | return 0; | 186 | return 0; |
184 | 187 | ||
185 | out: | 188 | out: |
186 | if (priv->rtc) | ||
187 | rtc_device_unregister(priv->rtc); | ||
188 | if (priv->reg) | 189 | if (priv->reg) |
189 | iounmap(priv->reg); | 190 | iounmap(priv->reg); |
190 | if (priv->baseaddr) | 191 | if (priv->baseaddr) |