Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6.git] / drivers / rtc / rtc-ds1307.c
index 8a6f9a9..c4ec5c1 100644 (file)
@@ -267,12 +267,7 @@ static void ds1307_work(struct work_struct *work)
                control &= ~DS1337_BIT_A1IE;
                i2c_smbus_write_byte_data(client, DS1337_REG_CONTROL, control);
 
-               /* rtc_update_irq() assumes that it is called
-                * from IRQ-disabled context.
-                */
-               local_irq_disable();
                rtc_update_irq(ds1307->rtc, 1, RTC_AF | RTC_IRQF);
-               local_irq_enable();
        }
 
 out:
@@ -879,13 +874,15 @@ read_rtc:
        }
 
        if (want_irq) {
-               err = request_irq(client->irq, ds1307_irq, 0,
+               err = request_irq(client->irq, ds1307_irq, IRQF_SHARED,
                          ds1307->rtc->name, client);
                if (err) {
                        dev_err(&client->dev,
                                "unable to request IRQ!\n");
                        goto exit_irq;
                }
+
+               device_set_wakeup_capable(&client->dev, 1);
                set_bit(HAS_ALARM, &ds1307->flags);
                dev_dbg(&client->dev, "got IRQ %d\n", client->irq);
        }
@@ -901,8 +898,7 @@ read_rtc:
        return 0;
 
 exit_irq:
-       if (ds1307->rtc)
-               rtc_device_unregister(ds1307->rtc);
+       rtc_device_unregister(ds1307->rtc);
 exit_free:
        kfree(ds1307);
        return err;