rtc-ds1742: fix races around device registration
[safe/jmp/linux-2.6] / drivers / rtc / rtc-pl031.c
index 08b4610..f41873f 100644 (file)
@@ -45,18 +45,6 @@ static irqreturn_t pl031_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int pl031_open(struct device *dev)
-{
-       /*
-        * We request IRQ in pl031_probe, so nothing to do here...
-        */
-       return 0;
-}
-
-static void pl031_release(struct device *dev)
-{
-}
-
 static int pl031_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 {
        struct pl031_local *ldata = dev_get_drvdata(dev);
@@ -118,8 +106,6 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 }
 
 static const struct rtc_class_ops pl031_ops = {
-       .open = pl031_open,
-       .release = pl031_release,
        .ioctl = pl031_ioctl,
        .read_time = pl031_read_time,
        .set_time = pl031_set_time,
@@ -141,7 +127,7 @@ static int pl031_remove(struct amba_device *adev)
        return 0;
 }
 
-static int pl031_probe(struct amba_device *adev, void *id)
+static int pl031_probe(struct amba_device *adev, struct amba_id *id)
 {
        int ret;
        struct pl031_local *ldata;
@@ -156,8 +142,7 @@ static int pl031_probe(struct amba_device *adev, void *id)
                goto out;
        }
 
-       ldata->base = ioremap(adev->res.start,
-                             adev->res.end - adev->res.start + 1);
+       ldata->base = ioremap(adev->res.start, resource_size(&adev->res));
        if (!ldata->base) {
                ret = -ENOMEM;
                goto out_no_remap;