Commit 2d7b20c1884777e66009be1a533641c19c4705f6

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 67f672f61b

[PATCH] m48t86: ia64 build fix

From: Andrew Morton <akpm@osdl.org>

drivers/rtc/rtc-m48t86.c: In function `m48t86_rtc_read_time':
drivers/rtc/rtc-m48t86.c:51: error: structure has no member named `ia64_mv'
drivers/rtc/rtc-m48t86.c:55: error: structure has no member named `ia64_mv'
drivers/rtc/rtc-m48t86.c:56: error: structure has no member named `ia64_mv'
drivers/rtc/rtc-m48t86.c:57: error: structure has no member named `ia64_mv'
drivers/rtc/rtc-m48t86.c:58: error: structure has no member named `ia64_mv'
drivers/rtc/rtc-m48t86.c:60: error: structure has no member named `ia64_mv'

readb() and writeb() are macros on ia64.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 38 additions and 38 deletions Side-by-side Diff

drivers/rtc/rtc-m48t86.c
... ... @@ -48,33 +48,33 @@
48 48 struct platform_device *pdev = to_platform_device(dev);
49 49 struct m48t86_ops *ops = pdev->dev.platform_data;
50 50  
51   - reg = ops->readb(M48T86_REG_B);
  51 + reg = ops->readbyte(M48T86_REG_B);
52 52  
53 53 if (reg & M48T86_REG_B_DM) {
54 54 /* data (binary) mode */
55   - tm->tm_sec = ops->readb(M48T86_REG_SEC);
56   - tm->tm_min = ops->readb(M48T86_REG_MIN);
57   - tm->tm_hour = ops->readb(M48T86_REG_HOUR) & 0x3F;
58   - tm->tm_mday = ops->readb(M48T86_REG_DOM);
  55 + tm->tm_sec = ops->readbyte(M48T86_REG_SEC);
  56 + tm->tm_min = ops->readbyte(M48T86_REG_MIN);
  57 + tm->tm_hour = ops->readbyte(M48T86_REG_HOUR) & 0x3F;
  58 + tm->tm_mday = ops->readbyte(M48T86_REG_DOM);
59 59 /* tm_mon is 0-11 */
60   - tm->tm_mon = ops->readb(M48T86_REG_MONTH) - 1;
61   - tm->tm_year = ops->readb(M48T86_REG_YEAR) + 100;
62   - tm->tm_wday = ops->readb(M48T86_REG_DOW);
  60 + tm->tm_mon = ops->readbyte(M48T86_REG_MONTH) - 1;
  61 + tm->tm_year = ops->readbyte(M48T86_REG_YEAR) + 100;
  62 + tm->tm_wday = ops->readbyte(M48T86_REG_DOW);
63 63 } else {
64 64 /* bcd mode */
65   - tm->tm_sec = BCD2BIN(ops->readb(M48T86_REG_SEC));
66   - tm->tm_min = BCD2BIN(ops->readb(M48T86_REG_MIN));
67   - tm->tm_hour = BCD2BIN(ops->readb(M48T86_REG_HOUR) & 0x3F);
68   - tm->tm_mday = BCD2BIN(ops->readb(M48T86_REG_DOM));
  65 + tm->tm_sec = BCD2BIN(ops->readbyte(M48T86_REG_SEC));
  66 + tm->tm_min = BCD2BIN(ops->readbyte(M48T86_REG_MIN));
  67 + tm->tm_hour = BCD2BIN(ops->readbyte(M48T86_REG_HOUR) & 0x3F);
  68 + tm->tm_mday = BCD2BIN(ops->readbyte(M48T86_REG_DOM));
69 69 /* tm_mon is 0-11 */
70   - tm->tm_mon = BCD2BIN(ops->readb(M48T86_REG_MONTH)) - 1;
71   - tm->tm_year = BCD2BIN(ops->readb(M48T86_REG_YEAR)) + 100;
72   - tm->tm_wday = BCD2BIN(ops->readb(M48T86_REG_DOW));
  70 + tm->tm_mon = BCD2BIN(ops->readbyte(M48T86_REG_MONTH)) - 1;
  71 + tm->tm_year = BCD2BIN(ops->readbyte(M48T86_REG_YEAR)) + 100;
  72 + tm->tm_wday = BCD2BIN(ops->readbyte(M48T86_REG_DOW));
73 73 }
74 74  
75 75 /* correct the hour if the clock is in 12h mode */
76 76 if (!(reg & M48T86_REG_B_H24))
77   - if (ops->readb(M48T86_REG_HOUR) & 0x80)
  77 + if (ops->readbyte(M48T86_REG_HOUR) & 0x80)
78 78 tm->tm_hour += 12;
79 79  
80 80 return 0;
81 81  
82 82  
83 83  
84 84  
... ... @@ -86,35 +86,35 @@
86 86 struct platform_device *pdev = to_platform_device(dev);
87 87 struct m48t86_ops *ops = pdev->dev.platform_data;
88 88  
89   - reg = ops->readb(M48T86_REG_B);
  89 + reg = ops->readbyte(M48T86_REG_B);
90 90  
91 91 /* update flag and 24h mode */
92 92 reg |= M48T86_REG_B_SET | M48T86_REG_B_H24;
93   - ops->writeb(reg, M48T86_REG_B);
  93 + ops->writebyte(reg, M48T86_REG_B);
94 94  
95 95 if (reg & M48T86_REG_B_DM) {
96 96 /* data (binary) mode */
97   - ops->writeb(tm->tm_sec, M48T86_REG_SEC);
98   - ops->writeb(tm->tm_min, M48T86_REG_MIN);
99   - ops->writeb(tm->tm_hour, M48T86_REG_HOUR);
100   - ops->writeb(tm->tm_mday, M48T86_REG_DOM);
101   - ops->writeb(tm->tm_mon + 1, M48T86_REG_MONTH);
102   - ops->writeb(tm->tm_year % 100, M48T86_REG_YEAR);
103   - ops->writeb(tm->tm_wday, M48T86_REG_DOW);
  97 + ops->writebyte(tm->tm_sec, M48T86_REG_SEC);
  98 + ops->writebyte(tm->tm_min, M48T86_REG_MIN);
  99 + ops->writebyte(tm->tm_hour, M48T86_REG_HOUR);
  100 + ops->writebyte(tm->tm_mday, M48T86_REG_DOM);
  101 + ops->writebyte(tm->tm_mon + 1, M48T86_REG_MONTH);
  102 + ops->writebyte(tm->tm_year % 100, M48T86_REG_YEAR);
  103 + ops->writebyte(tm->tm_wday, M48T86_REG_DOW);
104 104 } else {
105 105 /* bcd mode */
106   - ops->writeb(BIN2BCD(tm->tm_sec), M48T86_REG_SEC);
107   - ops->writeb(BIN2BCD(tm->tm_min), M48T86_REG_MIN);
108   - ops->writeb(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR);
109   - ops->writeb(BIN2BCD(tm->tm_mday), M48T86_REG_DOM);
110   - ops->writeb(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH);
111   - ops->writeb(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR);
112   - ops->writeb(BIN2BCD(tm->tm_wday), M48T86_REG_DOW);
  106 + ops->writebyte(BIN2BCD(tm->tm_sec), M48T86_REG_SEC);
  107 + ops->writebyte(BIN2BCD(tm->tm_min), M48T86_REG_MIN);
  108 + ops->writebyte(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR);
  109 + ops->writebyte(BIN2BCD(tm->tm_mday), M48T86_REG_DOM);
  110 + ops->writebyte(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH);
  111 + ops->writebyte(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR);
  112 + ops->writebyte(BIN2BCD(tm->tm_wday), M48T86_REG_DOW);
113 113 }
114 114  
115 115 /* update ended */
116 116 reg &= ~M48T86_REG_B_SET;
117   - ops->writeb(reg, M48T86_REG_B);
  117 + ops->writebyte(reg, M48T86_REG_B);
118 118  
119 119 return 0;
120 120 }
121 121  
... ... @@ -125,12 +125,12 @@
125 125 struct platform_device *pdev = to_platform_device(dev);
126 126 struct m48t86_ops *ops = pdev->dev.platform_data;
127 127  
128   - reg = ops->readb(M48T86_REG_B);
  128 + reg = ops->readbyte(M48T86_REG_B);
129 129  
130 130 seq_printf(seq, "mode\t\t: %s\n",
131 131 (reg & M48T86_REG_B_DM) ? "binary" : "bcd");
132 132  
133   - reg = ops->readb(M48T86_REG_D);
  133 + reg = ops->readbyte(M48T86_REG_D);
134 134  
135 135 seq_printf(seq, "battery\t\t: %s\n",
136 136 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted");
... ... @@ -157,7 +157,7 @@
157 157 platform_set_drvdata(dev, rtc);
158 158  
159 159 /* read battery status */
160   - reg = ops->readb(M48T86_REG_D);
  160 + reg = ops->readbyte(M48T86_REG_D);
161 161 dev_info(&dev->dev, "battery %s\n",
162 162 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted");
163 163  
include/linux/m48t86.h
... ... @@ -11,7 +11,7 @@
11 11  
12 12 struct m48t86_ops
13 13 {
14   - void (*writeb)(unsigned char value, unsigned long addr);
15   - unsigned char (*readb)(unsigned long addr);
  14 + void (*writebyte)(unsigned char value, unsigned long addr);
  15 + unsigned char (*readbyte)(unsigned long addr);
16 16 };