Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k/mac: Adopt naming and calling conventions for PRAM routines

Adopt the existing *_read_byte and *_write_byte naming convention.
Rename via_pram_readbyte and via_pram_writebyte to avoid confusion.
Adjust calling conventions of mac_pram_* functions to match the
struct nvram_ops methods.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Finn Thain and committed by
Greg Kroah-Hartman
cda67df5 666047fe

+23 -38
+23 -38
arch/m68k/mac/misc.c
··· 37 37 static void (*rom_reset)(void); 38 38 39 39 #ifdef CONFIG_ADB_CUDA 40 - static __u8 cuda_read_pram(int offset) 40 + static unsigned char cuda_pram_read_byte(int offset) 41 41 { 42 42 struct adb_request req; 43 43 ··· 49 49 return req.reply[3]; 50 50 } 51 51 52 - static void cuda_write_pram(int offset, __u8 data) 52 + static void cuda_pram_write_byte(unsigned char data, int offset) 53 53 { 54 54 struct adb_request req; 55 55 ··· 62 62 #endif /* CONFIG_ADB_CUDA */ 63 63 64 64 #ifdef CONFIG_ADB_PMU 65 - static __u8 pmu_read_pram(int offset) 65 + static unsigned char pmu_pram_read_byte(int offset) 66 66 { 67 67 struct adb_request req; 68 68 ··· 74 74 return req.reply[3]; 75 75 } 76 76 77 - static void pmu_write_pram(int offset, __u8 data) 77 + static void pmu_pram_write_byte(unsigned char data, int offset) 78 78 { 79 79 struct adb_request req; 80 80 ··· 93 93 * the RTC should be enabled. 94 94 */ 95 95 96 - static __u8 via_pram_readbyte(void) 96 + static __u8 via_rtc_recv(void) 97 97 { 98 98 int i, reg; 99 99 __u8 data; ··· 120 120 return data; 121 121 } 122 122 123 - static void via_pram_writebyte(__u8 data) 123 + static void via_rtc_send(__u8 data) 124 124 { 125 125 int i, reg, bit; 126 126 ··· 157 157 via1[vBufB] = (via1[vBufB] | VIA1B_vRTCClk) & ~VIA1B_vRTCEnb; 158 158 159 159 if (command & 0xFF00) { /* extended (two-byte) command */ 160 - via_pram_writebyte((command & 0xFF00) >> 8); 161 - via_pram_writebyte(command & 0xFF); 160 + via_rtc_send((command & 0xFF00) >> 8); 161 + via_rtc_send(command & 0xFF); 162 162 is_read = command & 0x8000; 163 163 } else { /* one-byte command */ 164 - via_pram_writebyte(command); 164 + via_rtc_send(command); 165 165 is_read = command & 0x80; 166 166 } 167 167 if (is_read) { 168 - *data = via_pram_readbyte(); 168 + *data = via_rtc_recv(); 169 169 } else { 170 - via_pram_writebyte(*data); 170 + via_rtc_send(*data); 171 171 } 172 172 173 173 /* All done, disable the RTC */ ··· 177 177 local_irq_restore(flags); 178 178 } 179 179 180 - static __u8 via_read_pram(int offset) 180 + static unsigned char via_pram_read_byte(int offset) 181 181 { 182 182 return 0; 183 183 } 184 184 185 - static void via_write_pram(int offset, __u8 data) 185 + static void via_pram_write_byte(unsigned char data, int offset) 186 186 { 187 187 } 188 188 ··· 326 326 *------------------------------------------------------------------- 327 327 */ 328 328 329 - void mac_pram_read(int offset, __u8 *buffer, int len) 329 + unsigned char mac_pram_read_byte(int addr) 330 330 { 331 - __u8 (*func)(int); 332 - int i; 333 - 334 331 switch (macintosh_config->adb_type) { 335 332 case MAC_ADB_IOP: 336 333 case MAC_ADB_II: 337 334 case MAC_ADB_PB1: 338 - func = via_read_pram; 339 - break; 335 + return via_pram_read_byte(addr); 340 336 #ifdef CONFIG_ADB_CUDA 341 337 case MAC_ADB_EGRET: 342 338 case MAC_ADB_CUDA: 343 - func = cuda_read_pram; 344 - break; 339 + return cuda_pram_read_byte(addr); 345 340 #endif 346 341 #ifdef CONFIG_ADB_PMU 347 342 case MAC_ADB_PB2: 348 - func = pmu_read_pram; 349 - break; 343 + return pmu_pram_read_byte(addr); 350 344 #endif 351 345 default: 352 - return; 353 - } 354 - for (i = 0 ; i < len ; i++) { 355 - buffer[i] = (*func)(offset++); 346 + return 0xFF; 356 347 } 357 348 } 358 349 359 - void mac_pram_write(int offset, __u8 *buffer, int len) 350 + void mac_pram_write_byte(unsigned char val, int addr) 360 351 { 361 - void (*func)(int, __u8); 362 - int i; 363 - 364 352 switch (macintosh_config->adb_type) { 365 353 case MAC_ADB_IOP: 366 354 case MAC_ADB_II: 367 355 case MAC_ADB_PB1: 368 - func = via_write_pram; 356 + via_pram_write_byte(val, addr); 369 357 break; 370 358 #ifdef CONFIG_ADB_CUDA 371 359 case MAC_ADB_EGRET: 372 360 case MAC_ADB_CUDA: 373 - func = cuda_write_pram; 361 + cuda_pram_write_byte(val, addr); 374 362 break; 375 363 #endif 376 364 #ifdef CONFIG_ADB_PMU 377 365 case MAC_ADB_PB2: 378 - func = pmu_write_pram; 366 + pmu_pram_write_byte(val, addr); 379 367 break; 380 368 #endif 381 369 default: 382 - return; 383 - } 384 - for (i = 0 ; i < len ; i++) { 385 - (*func)(offset++, buffer[i]); 370 + break; 386 371 } 387 372 } 388 373