fbdev: move FBIO_WAITFORVSYNC to linux/fb.h
[safe/jmp/linux-2.6] / drivers / rtc / rtc-v3020.c
index 434e92f..f71c3ce 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/rtc-v3020.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/slab.h>
 
 #include <linux/io.h>
 
@@ -96,7 +97,7 @@ static void v3020_mmio_write_bit(struct v3020 *chip, unsigned char bit)
 
 static unsigned char v3020_mmio_read_bit(struct v3020 *chip)
 {
-       return readl(chip->ioaddress) & (1 << chip->leftshift);
+       return !!(readl(chip->ioaddress) & (1 << chip->leftshift));
 }
 
 static struct v3020_chip_ops v3020_mmio_ops = {
@@ -304,7 +305,6 @@ static int rtc_probe(struct platform_device *pdev)
 {
        struct v3020_platform_data *pdata = pdev->dev.platform_data;
        struct v3020 *chip;
-       struct rtc_device *rtc;
        int retval = -EBUSY;
        int i;
        int temp;
@@ -353,13 +353,12 @@ static int rtc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, chip);
 
-       rtc = rtc_device_register("v3020",
+       chip->rtc = rtc_device_register("v3020",
                                &pdev->dev, &v3020_rtc_ops, THIS_MODULE);
-       if (IS_ERR(rtc)) {
-               retval = PTR_ERR(rtc);
+       if (IS_ERR(chip->rtc)) {
+               retval = PTR_ERR(chip->rtc);
                goto err_io;
        }
-       chip->rtc = rtc;
 
        return 0;