aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-m48t35.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-m48t35.c')
-rw-r--r--drivers/rtc/rtc-m48t35.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c
index 0b2197559940..8cb5b8959e5b 100644
--- a/drivers/rtc/rtc-m48t35.c
+++ b/drivers/rtc/rtc-m48t35.c
@@ -142,7 +142,6 @@ static const struct rtc_class_ops m48t35_ops = {
142 142
143static int __devinit m48t35_probe(struct platform_device *pdev) 143static int __devinit m48t35_probe(struct platform_device *pdev)
144{ 144{
145 struct rtc_device *rtc;
146 struct resource *res; 145 struct resource *res;
147 struct m48t35_priv *priv; 146 struct m48t35_priv *priv;
148 int ret = 0; 147 int ret = 0;
@@ -171,20 +170,21 @@ static int __devinit m48t35_probe(struct platform_device *pdev)
171 ret = -ENOMEM; 170 ret = -ENOMEM;
172 goto out; 171 goto out;
173 } 172 }
173
174 spin_lock_init(&priv->lock); 174 spin_lock_init(&priv->lock);
175 rtc = rtc_device_register("m48t35", &pdev->dev, 175
176 platform_set_drvdata(pdev, priv);
177
178 priv->rtc = rtc_device_register("m48t35", &pdev->dev,
176 &m48t35_ops, THIS_MODULE); 179 &m48t35_ops, THIS_MODULE);
177 if (IS_ERR(rtc)) { 180 if (IS_ERR(priv->rtc)) {
178 ret = PTR_ERR(rtc); 181 ret = PTR_ERR(priv->rtc);
179 goto out; 182 goto out;
180 } 183 }
181 priv->rtc = rtc; 184
182 platform_set_drvdata(pdev, priv);
183 return 0; 185 return 0;
184 186
185out: 187out:
186 if (priv->rtc)
187 rtc_device_unregister(priv->rtc);
188 if (priv->reg) 188 if (priv->reg)
189 iounmap(priv->reg); 189 iounmap(priv->reg);
190 if (priv->baseaddr) 190 if (priv->baseaddr)