diff options
Diffstat (limited to 'drivers/rtc/rtc-ds1305.c')
-rw-r--r-- | drivers/rtc/rtc-ds1305.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 2736b11a1b1e..9630e7d3314e 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -617,7 +617,6 @@ static struct bin_attribute nvram = { | |||
617 | static int __devinit ds1305_probe(struct spi_device *spi) | 617 | static int __devinit ds1305_probe(struct spi_device *spi) |
618 | { | 618 | { |
619 | struct ds1305 *ds1305; | 619 | struct ds1305 *ds1305; |
620 | struct rtc_device *rtc; | ||
621 | int status; | 620 | int status; |
622 | u8 addr, value; | 621 | u8 addr, value; |
623 | struct ds1305_platform_data *pdata = spi->dev.platform_data; | 622 | struct ds1305_platform_data *pdata = spi->dev.platform_data; |
@@ -756,14 +755,13 @@ static int __devinit ds1305_probe(struct spi_device *spi) | |||
756 | dev_dbg(&spi->dev, "AM/PM\n"); | 755 | dev_dbg(&spi->dev, "AM/PM\n"); |
757 | 756 | ||
758 | /* register RTC ... from here on, ds1305->ctrl needs locking */ | 757 | /* register RTC ... from here on, ds1305->ctrl needs locking */ |
759 | rtc = rtc_device_register("ds1305", &spi->dev, | 758 | ds1305->rtc = rtc_device_register("ds1305", &spi->dev, |
760 | &ds1305_ops, THIS_MODULE); | 759 | &ds1305_ops, THIS_MODULE); |
761 | if (IS_ERR(rtc)) { | 760 | if (IS_ERR(ds1305->rtc)) { |
762 | status = PTR_ERR(rtc); | 761 | status = PTR_ERR(ds1305->rtc); |
763 | dev_dbg(&spi->dev, "register rtc --> %d\n", status); | 762 | dev_dbg(&spi->dev, "register rtc --> %d\n", status); |
764 | goto fail0; | 763 | goto fail0; |
765 | } | 764 | } |
766 | ds1305->rtc = rtc; | ||
767 | 765 | ||
768 | /* Maybe set up alarm IRQ; be ready to handle it triggering right | 766 | /* Maybe set up alarm IRQ; be ready to handle it triggering right |
769 | * away. NOTE that we don't share this. The signal is active low, | 767 | * away. NOTE that we don't share this. The signal is active low, |
@@ -774,12 +772,14 @@ static int __devinit ds1305_probe(struct spi_device *spi) | |||
774 | if (spi->irq) { | 772 | if (spi->irq) { |
775 | INIT_WORK(&ds1305->work, ds1305_work); | 773 | INIT_WORK(&ds1305->work, ds1305_work); |
776 | status = request_irq(spi->irq, ds1305_irq, | 774 | status = request_irq(spi->irq, ds1305_irq, |
777 | 0, dev_name(&rtc->dev), ds1305); | 775 | 0, dev_name(&ds1305->rtc->dev), ds1305); |
778 | if (status < 0) { | 776 | if (status < 0) { |
779 | dev_dbg(&spi->dev, "request_irq %d --> %d\n", | 777 | dev_dbg(&spi->dev, "request_irq %d --> %d\n", |
780 | spi->irq, status); | 778 | spi->irq, status); |
781 | goto fail1; | 779 | goto fail1; |
782 | } | 780 | } |
781 | |||
782 | device_set_wakeup_capable(&spi->dev, 1); | ||
783 | } | 783 | } |
784 | 784 | ||
785 | /* export NVRAM */ | 785 | /* export NVRAM */ |
@@ -794,7 +794,7 @@ static int __devinit ds1305_probe(struct spi_device *spi) | |||
794 | fail2: | 794 | fail2: |
795 | free_irq(spi->irq, ds1305); | 795 | free_irq(spi->irq, ds1305); |
796 | fail1: | 796 | fail1: |
797 | rtc_device_unregister(rtc); | 797 | rtc_device_unregister(ds1305->rtc); |
798 | fail0: | 798 | fail0: |
799 | kfree(ds1305); | 799 | kfree(ds1305); |
800 | return status; | 800 | return status; |
@@ -802,7 +802,7 @@ fail0: | |||
802 | 802 | ||
803 | static int __devexit ds1305_remove(struct spi_device *spi) | 803 | static int __devexit ds1305_remove(struct spi_device *spi) |
804 | { | 804 | { |
805 | struct ds1305 *ds1305 = spi_get_drvdata(spi); | 805 | struct ds1305 *ds1305 = spi_get_drvdata(spi); |
806 | 806 | ||
807 | sysfs_remove_bin_file(&spi->dev.kobj, &nvram); | 807 | sysfs_remove_bin_file(&spi->dev.kobj, &nvram); |
808 | 808 | ||