* rtc: pcf8523: Rename REG_OFFSET
@ 2021-06-20 0:42 Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2021-06-20 0:42 UTC (permalink / raw)
To: linux-rtc; +Cc: Alessandro Zummo, Alexandre Belloni
Moving ARM to the generic irqstat infrastructure caused
arch/arm/mach-ixp4xx/include/mach/platform.h to be included indirectly in
interrupt related headers, which results in a build failure:
>> drivers/rtc/rtc-pcf8523.c:35: warning: "REG_OFFSET" redefined
35 | #define REG_OFFSET 0x0e
Rename it to PCF_REG_OFFSET and for consistency the mode define to
PCF_REG_OFFSET_MODE.
Fixes: 7fd70c65faac ("ARM: irqstat: Get rid of duplicated declaration")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
---
drivers/rtc/rtc-pcf8523.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -41,8 +41,8 @@
#define REG_WEEKDAY_ALARM 0x0d
#define ALARM_DIS BIT(7)
-#define REG_OFFSET 0x0e
-#define REG_OFFSET_MODE BIT(7)
+#define PCF_REG_OFFSET 0x0e
+#define PCF_REG_OFFSET_MODE BIT(7)
#define REG_TMR_CLKOUT_CTRL 0x0f
@@ -442,13 +442,13 @@ static int pcf8523_rtc_read_offset(struc
u8 value;
s8 val;
- err = pcf8523_read(client, REG_OFFSET, &value);
+ err = pcf8523_read(client, PCF_REG_OFFSET, &value);
if (err < 0)
return err;
/* sign extend the 7-bit offset value */
val = value << 1;
- *offset = (value & REG_OFFSET_MODE ? 4069 : 4340) * (val >> 1);
+ *offset = (value & PCF_REG_OFFSET_MODE ? 4069 : 4340) * (val >> 1);
return 0;
}
@@ -465,9 +465,9 @@ static int pcf8523_rtc_set_offset(struct
if (abs(reg_m0 * 4340 - offset) < abs(reg_m1 * 4069 - offset))
value = reg_m0 & 0x7f;
else
- value = (reg_m1 & 0x7f) | REG_OFFSET_MODE;
+ value = (reg_m1 & 0x7f) | PCF_REG_OFFSET_MODE;
- return pcf8523_write(client, REG_OFFSET, value);
+ return pcf8523_write(client, PCF_REG_OFFSET, value);
}
static const struct rtc_class_ops pcf8523_rtc_ops = {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-20 0:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-20 0:42 rtc: pcf8523: Rename REG_OFFSET Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).