aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-07-17 15:16:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:24:39 -0400
commit5575d0a3c9676b2886adad67dd4b2ac126a49f1f (patch)
treee8b14fcf6d79bbaf174974b28b50c2a5e347bbdd
parent0795dbcc4c4c93a929463957993c04cf5fec346c (diff)
m68k/atari/debug.c: possible cleanups
This patch contains the following possible cleanups: - make the following needlessly global functions (always) static: - atari_mfp_console_write() - atari_scc_console_write() - atari_midi_console_write() - atari_init_mfp_port() - atari_init_scc_port() - atari_init_midi_port() - #if 0 the following unused functions: - atari_mfp_console_wait_key() - atari_scc_console_wait_key() - atari_midi_console_wait_key() - remove the following unused variables: - atari_MFP_init_done - atari_SCC_init_done Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/m68k/atari/debug.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c
index 043ddbc61c7b..702b15ccfab7 100644
--- a/arch/m68k/atari/debug.c
+++ b/arch/m68k/atari/debug.c
@@ -20,14 +20,6 @@
20#include <asm/atarihw.h> 20#include <asm/atarihw.h>
21#include <asm/atariints.h> 21#include <asm/atariints.h>
22 22
23/* Flag that Modem1 port is already initialized and used */
24int atari_MFP_init_done;
25EXPORT_SYMBOL(atari_MFP_init_done);
26
27/* Flag that Modem1 port is already initialized and used */
28int atari_SCC_init_done;
29EXPORT_SYMBOL(atari_SCC_init_done);
30
31/* Can be set somewhere, if a SCC master reset has already be done and should 23/* Can be set somewhere, if a SCC master reset has already be done and should
32 * not be repeated; used by kgdb */ 24 * not be repeated; used by kgdb */
33int atari_SCC_reset_done; 25int atari_SCC_reset_done;
@@ -47,8 +39,8 @@ static inline void ata_mfp_out(char c)
47 mfp.usart_dta = c; 39 mfp.usart_dta = c;
48} 40}
49 41
50void atari_mfp_console_write(struct console *co, const char *str, 42static void atari_mfp_console_write(struct console *co, const char *str,
51 unsigned int count) 43 unsigned int count)
52{ 44{
53 while (count--) { 45 while (count--) {
54 if (*str == '\n') 46 if (*str == '\n')
@@ -66,8 +58,8 @@ static inline void ata_scc_out(char c)
66 scc.cha_b_data = c; 58 scc.cha_b_data = c;
67} 59}
68 60
69void atari_scc_console_write(struct console *co, const char *str, 61static void atari_scc_console_write(struct console *co, const char *str,
70 unsigned int count) 62 unsigned int count)
71{ 63{
72 while (count--) { 64 while (count--) {
73 if (*str == '\n') 65 if (*str == '\n')
@@ -83,8 +75,8 @@ static inline void ata_midi_out(char c)
83 acia.mid_data = c; 75 acia.mid_data = c;
84} 76}
85 77
86void atari_midi_console_write(struct console *co, const char *str, 78static void atari_midi_console_write(struct console *co, const char *str,
87 unsigned int count) 79 unsigned int count)
88{ 80{
89 while (count--) { 81 while (count--) {
90 if (*str == '\n') 82 if (*str == '\n')
@@ -136,7 +128,7 @@ static void atari_par_console_write(struct console *co, const char *str,
136 } 128 }
137} 129}
138 130
139#ifdef CONFIG_SERIAL_CONSOLE 131#if 0
140int atari_mfp_console_wait_key(struct console *co) 132int atari_mfp_console_wait_key(struct console *co)
141{ 133{
142 while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */ 134 while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */
@@ -166,11 +158,7 @@ int atari_midi_console_wait_key(struct console *co)
166 * SCC serial ports. They're used by the debugging interface, kgdb, and the 158 * SCC serial ports. They're used by the debugging interface, kgdb, and the
167 * serial console code. 159 * serial console code.
168 */ 160 */
169#ifndef CONFIG_SERIAL_CONSOLE
170static void __init atari_init_mfp_port(int cflag) 161static void __init atari_init_mfp_port(int cflag)
171#else
172void atari_init_mfp_port(int cflag)
173#endif
174{ 162{
175 /* 163 /*
176 * timer values for 1200...115200 bps; > 38400 select 110, 134, or 150 164 * timer values for 1200...115200 bps; > 38400 select 110, 134, or 150
@@ -193,8 +181,6 @@ void atari_init_mfp_port(int cflag)
193 mfp.tim_dt_d = baud_table[baud]; 181 mfp.tim_dt_d = baud_table[baud];
194 mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */ 182 mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */
195 mfp.trn_stat |= 0x01; /* enable TX */ 183 mfp.trn_stat |= 0x01; /* enable TX */
196
197 atari_MFP_init_done = 1;
198} 184}
199 185
200#define SCC_WRITE(reg, val) \ 186#define SCC_WRITE(reg, val) \
@@ -214,11 +200,7 @@ void atari_init_mfp_port(int cflag)
214 MFPDELAY(); \ 200 MFPDELAY(); \
215 } while (0) 201 } while (0)
216 202
217#ifndef CONFIG_SERIAL_CONSOLE
218static void __init atari_init_scc_port(int cflag) 203static void __init atari_init_scc_port(int cflag)
219#else
220void atari_init_scc_port(int cflag)
221#endif
222{ 204{
223 extern int atari_SCC_reset_done; 205 extern int atari_SCC_reset_done;
224 static int clksrc_table[9] = 206 static int clksrc_table[9] =
@@ -277,14 +259,9 @@ void atari_init_scc_port(int cflag)
277 SCC_WRITE(5, reg5 | 8); 259 SCC_WRITE(5, reg5 | 8);
278 260
279 atari_SCC_reset_done = 1; 261 atari_SCC_reset_done = 1;
280 atari_SCC_init_done = 1;
281} 262}
282 263
283#ifndef CONFIG_SERIAL_CONSOLE
284static void __init atari_init_midi_port(int cflag) 264static void __init atari_init_midi_port(int cflag)
285#else
286void atari_init_midi_port(int cflag)
287#endif
288{ 265{
289 int baud = cflag & CBAUD; 266 int baud = cflag & CBAUD;
290 int csize = ((cflag & CSIZE) == CS8) ? 0x10 : 0x00; 267 int csize = ((cflag & CSIZE) == CS8) ? 0x10 : 0x00;
">->ioaddr.lbam_addr = info->ide_addr + (ATA_REG_LBAM << 1); ap->ioaddr.lbah_addr = info->ide_addr + (ATA_REG_LBAH << 1); ap->ioaddr.device_addr = info->ide_addr + (ATA_REG_DEVICE << 1); ap->ioaddr.status_addr = info->ide_addr + (ATA_REG_STATUS << 1); ap->ioaddr.command_addr = info->ide_addr + (ATA_REG_CMD << 1); /* Set info as private data of ATA host */ host->private_data = info; /* Register ATA device and return */ return ata_host_activate(host, info->irq, ata_interrupt, IRQF_SHARED | IRQF_TRIGGER_RISING, &at32_sht); } /* * This function may come in handy for people analyzing their own * EBI -> PATA adaptors. */ #ifdef DEBUG_BUS static void __init pata_at32_debug_bus(struct device *dev, struct at32_ide_info *info) { const int d1 = 0xff; const int d2 = 0x00; int i; /* Write 8-bit values (registers) */ iowrite8(d1, info->alt_addr + (0x06 << 1)); iowrite8(d2, info->alt_addr + (0x06 << 1)); for (i = 0; i < 8; i++) { iowrite8(d1, info->ide_addr + (i << 1)); iowrite8(d2, info->ide_addr + (i << 1)); } /* Write 16 bit values (data) */ iowrite16(d1, info->ide_addr); iowrite16(d1 << 8, info->ide_addr); iowrite16(d1, info->ide_addr); iowrite16(d1 << 8, info->ide_addr); } #endif static int __init pata_at32_probe(struct platform_device *pdev) { const struct ata_timing initial_timing = {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0}; struct device *dev = &pdev->dev; struct at32_ide_info *info; struct ide_platform_data *board = pdev->dev.platform_data; struct resource *res; int irq; int ret; if (!board) return -ENXIO; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO; /* Retrive IRQ */ irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; /* Setup struct containing private information */ info = kzalloc(sizeof(struct at32_ide_info), GFP_KERNEL); if (!info) return -ENOMEM; memset(info, 0, sizeof(struct at32_ide_info)); info->irq = irq; info->cs = board->cs; /* Request memory resources */ info->res_ide.start = res->start + CF_IDE_OFFSET; info->res_ide.end = info->res_ide.start + CF_RES_SIZE - 1; info->res_ide.name = "ide"; info->res_ide.flags = IORESOURCE_MEM; ret = request_resource(res, &info->res_ide); if (ret) goto err_req_res_ide; info->res_alt.start = res->start + CF_ALT_IDE_OFFSET; info->res_alt.end = info->res_alt.start + CF_RES_SIZE - 1; info->res_alt.name = "alt"; info->res_alt.flags = IORESOURCE_MEM; ret = request_resource(res, &info->res_alt); if (ret) goto err_req_res_alt; /* Setup non-timing elements of SMC */ info->smc.bus_width = 2; /* 16 bit data bus */ info->smc.nrd_controlled = 1; /* Sample data on rising edge of NRD */ info->smc.nwe_controlled = 0; /* Drive data on falling edge of NCS */ info->smc.nwait_mode = 3; /* NWAIT is in READY mode */ info->smc.byte_write = 0; /* Byte select access type */ info->smc.tdf_mode = 0; /* TDF optimization disabled */ info->smc.tdf_cycles = 0; /* No TDF wait cycles */ /* Setup SMC to ATA timing */ ret = pata_at32_setup_timing(dev, info, &initial_timing); if (ret) goto err_setup_timing; /* Map ATA address space */ ret = -ENOMEM; info->ide_addr = devm_ioremap(dev, info->res_ide.start, 16); info->alt_addr = devm_ioremap(dev, info->res_alt.start, 16); if (!info->ide_addr || !info->alt_addr) goto err_ioremap; #ifdef DEBUG_BUS pata_at32_debug_bus(dev, info); #endif /* Setup and register ATA device */ ret = pata_at32_init_one(dev, info); if (ret) goto err_ata_device; return 0; err_ata_device: err_ioremap: err_setup_timing: release_resource(&info->res_alt); err_req_res_alt: release_resource(&info->res_ide); err_req_res_ide: kfree(info); return ret; } static int __exit pata_at32_remove(struct platform_device *pdev) { struct ata_host *host = platform_get_drvdata(pdev); struct at32_ide_info *info; if (!host) return 0; info = host->private_data; ata_host_detach(host); if (!info) return 0; release_resource(&info->res_ide); release_resource(&info->res_alt); kfree(info); return 0; } static struct platform_driver pata_at32_driver = { .remove = __exit_p(pata_at32_remove), .driver = { .name = "at32_ide", .owner = THIS_MODULE, }, }; static int __init pata_at32_init(void) { return platform_driver_probe(&pata_at32_driver, pata_at32_probe); } static void __exit pata_at32_exit(void) { platform_driver_unregister(&pata_at32_driver); } module_init(pata_at32_init); module_exit(pata_at32_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("AVR32 SMC/CFC PATA Driver"); MODULE_AUTHOR("Kristoffer Nyborg Gregertsen <kngregertsen@norway.atmel.com>"); MODULE_VERSION(DRV_VERSION);