Skip to contentSkip to conversation

rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error

The newly added ds1685 driver causes a build error in linux-next when enabled without CONFIG_RTC_INTF_DEV:

drivers/rtc/rtc-ds1685.c:919:22: error: 'ds1685_rtc_alarm_irq_enable' undeclared here (not in a function)
.alarm_irq_enable = ds1685_rtc_alarm_irq_enable,

Apparently the driver was incorrectly changed to reflect the interface change from 16380c153a69c ("RTC: Convert rtc drivers to use the alarm_irq_enable method"), which removed the respective #ifdef from all other rtc drivers.

This does the same change that was merged for the other drivers before and removes the #ifdef, allowing the interrupts to be enabled through the in-kernel rtc interface independent of the existence of /dev/rtc.

Fixes aaaf5fbf56f ("rtc: add driver for DS1685 family of real time clocks")

---
For some reason, this error never showed up in linux-next, but it does now that the driver has made it into mainline, while doing ARM randconfig testing.

drivers/rtc/rtc-ds1685.c +0 -2
index 8c3bfcb115b7..5dc1ef9d0008 100644
@@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 /* ----------------------------------------------------------------------- */
 /* /dev/rtcX Interface functions */
 
-#ifdef CONFIG_RTC_INTF_DEV
 /**
  * ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off.
  * @dev: pointer to device structure.
@@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 
 	return 0;
 }
-#endif
 /* ----------------------------------------------------------------------- */
 
 
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

The newly added ds1685 driver causes a build error in linux-next when enabled without CONFIG_RTC_INTF_DEV:

drivers/rtc/rtc-ds1685.c:919:22: error: 'ds1685_rtc_alarm_irq_enable' undeclared here (not in a function)
.alarm_irq_enable = ds1685_rtc_alarm_irq_enable,

Apparently the driver was incorrectly changed to reflect the interface change from 16380c153a69c ("RTC: Convert rtc drivers to use the alarm_irq_enable method"), which removed the respective #ifdef from all other rtc drivers.

Quoted 7 lines

This does the same change that was merged for the other drivers before and removes the #ifdef, allowing the interrupts to be enabled through the in-kernel rtc interface independent of the existence of /dev/rtc.

Fixes aaaf5fbf56f ("rtc: add driver for DS1685 family of real time clocks")

I probably copied that #define out of another RTC driver before the change was made, then discovered the compile failure later on and just didn't read enough to understand the change, thus only fixing it enough to compile again.

Thanks for catching it!

Quoted 26 lines

---
For some reason, this error never showed up in linux-next, but it does now that the driver has made it into mainline, while doing ARM randconfig testing.

drivers/rtc/rtc-ds1685.c +0 -2
index 8c3bfcb115b7..5dc1ef9d0008 100644
@@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 /* ----------------------------------------------------------------------- */
 /* /dev/rtcX Interface functions */
 
-#ifdef CONFIG_RTC_INTF_DEV
 /**
  * ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off.
  * @dev: pointer to device structure.
@@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 
 	return 0;
 }
-#endif
 /* ----------------------------------------------------------------------- */