summaryrefslogtreecommitdiffstats
path: root/sound/oss/uart401.c
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-08-06 08:47:25 -0400
committerTakashi Iwai <tiwai@suse.de>2014-08-06 10:42:29 -0400
commit80e7bbac48c440c32cc00870bf91ecf27a6de443 (patch)
treeab50bcbc61dd7482715fbc464ea365d1119f2f47 /sound/oss/uart401.c
parenta509574e5ea7b617268943526773ebf7e2d20a9b (diff)
sound: oss: uart401: Remove typedef uart401_devc
The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for uart401_devc. The following Coccinelle semantic patch detects the case. @tn@ identifier i; type td; @@ -typedef struct i { ... } -td ; @@ type tn.td; identifier tn.i; @@ -td + struct i Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/oss/uart401.c')
-rw-r--r--sound/oss/uart401.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
index 62b8869f5a4c..279bc565ac7e 100644
--- a/sound/oss/uart401.c
+++ b/sound/oss/uart401.c
@@ -30,7 +30,7 @@
30 30
31#include "mpu401.h" 31#include "mpu401.h"
32 32
33typedef struct uart401_devc 33struct uart401_devc
34{ 34{
35 int base; 35 int base;
36 int irq; 36 int irq;
@@ -41,14 +41,13 @@ typedef struct uart401_devc
41 int my_dev; 41 int my_dev;
42 int share_irq; 42 int share_irq;
43 spinlock_t lock; 43 spinlock_t lock;
44} 44};
45uart401_devc;
46 45
47#define DATAPORT (devc->base) 46#define DATAPORT (devc->base)
48#define COMDPORT (devc->base+1) 47#define COMDPORT (devc->base+1)
49#define STATPORT (devc->base+1) 48#define STATPORT (devc->base+1)
50 49
51static int uart401_status(uart401_devc * devc) 50static int uart401_status(struct uart401_devc *devc)
52{ 51{
53 return inb(STATPORT); 52 return inb(STATPORT);
54} 53}
@@ -56,17 +55,17 @@ static int uart401_status(uart401_devc * devc)
56#define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL)) 55#define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL))
57#define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY)) 56#define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY))
58 57
59static void uart401_cmd(uart401_devc * devc, unsigned char cmd) 58static void uart401_cmd(struct uart401_devc *devc, unsigned char cmd)
60{ 59{
61 outb((cmd), COMDPORT); 60 outb((cmd), COMDPORT);
62} 61}
63 62
64static int uart401_read(uart401_devc * devc) 63static int uart401_read(struct uart401_devc *devc)
65{ 64{
66 return inb(DATAPORT); 65 return inb(DATAPORT);
67} 66}
68 67
69static void uart401_write(uart401_devc * devc, unsigned char byte) 68static void uart401_write(struct uart401_devc *devc, unsigned char byte)
70{ 69{
71 outb((byte), DATAPORT); 70 outb((byte), DATAPORT);
72} 71}
@@ -77,10 +76,10 @@ static void uart401_write(uart401_devc * devc, unsigned char byte)
77#define MPU_RESET 0xFF 76#define MPU_RESET 0xFF
78#define UART_MODE_ON 0x3F 77#define UART_MODE_ON 0x3F
79 78
80static int reset_uart401(uart401_devc * devc); 79static int reset_uart401(struct uart401_devc *devc);
81static void enter_uart_mode(uart401_devc * devc); 80static void enter_uart_mode(struct uart401_devc *devc);
82 81
83static void uart401_input_loop(uart401_devc * devc) 82static void uart401_input_loop(struct uart401_devc *devc)
84{ 83{
85 int work_limit=30000; 84 int work_limit=30000;
86 85
@@ -99,7 +98,7 @@ static void uart401_input_loop(uart401_devc * devc)
99 98
100irqreturn_t uart401intr(int irq, void *dev_id) 99irqreturn_t uart401intr(int irq, void *dev_id)
101{ 100{
102 uart401_devc *devc = dev_id; 101 struct uart401_devc *devc = dev_id;
103 102
104 if (devc == NULL) 103 if (devc == NULL)
105 { 104 {
@@ -118,7 +117,8 @@ uart401_open(int dev, int mode,
118 void (*output) (int dev) 117 void (*output) (int dev)
119) 118)
120{ 119{
121 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 120 struct uart401_devc *devc = (struct uart401_devc *)
121 midi_devs[dev]->devc;
122 122
123 if (devc->opened) 123 if (devc->opened)
124 return -EBUSY; 124 return -EBUSY;
@@ -138,7 +138,8 @@ uart401_open(int dev, int mode,
138 138
139static void uart401_close(int dev) 139static void uart401_close(int dev)
140{ 140{
141 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 141 struct uart401_devc *devc = (struct uart401_devc *)
142 midi_devs[dev]->devc;
142 143
143 reset_uart401(devc); 144 reset_uart401(devc);
144 devc->opened = 0; 145 devc->opened = 0;
@@ -148,7 +149,8 @@ static int uart401_out(int dev, unsigned char midi_byte)
148{ 149{
149 int timeout; 150 int timeout;
150 unsigned long flags; 151 unsigned long flags;
151 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 152 struct uart401_devc *devc = (struct uart401_devc *)
153 midi_devs[dev]->devc;
152 154
153 if (devc->disabled) 155 if (devc->disabled)
154 return 1; 156 return 1;
@@ -219,7 +221,7 @@ static const struct midi_operations uart401_operations =
219 .buffer_status = uart401_buffer_status, 221 .buffer_status = uart401_buffer_status,
220}; 222};
221 223
222static void enter_uart_mode(uart401_devc * devc) 224static void enter_uart_mode(struct uart401_devc *devc)
223{ 225{
224 int ok, timeout; 226 int ok, timeout;
225 unsigned long flags; 227 unsigned long flags;
@@ -241,7 +243,7 @@ static void enter_uart_mode(uart401_devc * devc)
241 spin_unlock_irqrestore(&devc->lock,flags); 243 spin_unlock_irqrestore(&devc->lock,flags);
242} 244}
243 245
244static int reset_uart401(uart401_devc * devc) 246static int reset_uart401(struct uart401_devc *devc)
245{ 247{
246 int ok, timeout, n; 248 int ok, timeout, n;
247 249
@@ -285,7 +287,7 @@ static int reset_uart401(uart401_devc * devc)
285 287
286int probe_uart401(struct address_info *hw_config, struct module *owner) 288int probe_uart401(struct address_info *hw_config, struct module *owner)
287{ 289{
288 uart401_devc *devc; 290 struct uart401_devc *devc;
289 char *name = "MPU-401 (UART) MIDI"; 291 char *name = "MPU-401 (UART) MIDI";
290 int ok = 0; 292 int ok = 0;
291 unsigned long flags; 293 unsigned long flags;
@@ -300,7 +302,7 @@ int probe_uart401(struct address_info *hw_config, struct module *owner)
300 return 0; 302 return 0;
301 } 303 }
302 304
303 devc = kmalloc(sizeof(uart401_devc), GFP_KERNEL); 305 devc = kmalloc(sizeof(struct uart401_devc), GFP_KERNEL);
304 if (!devc) { 306 if (!devc) {
305 printk(KERN_WARNING "uart401: Can't allocate memory\n"); 307 printk(KERN_WARNING "uart401: Can't allocate memory\n");
306 goto cleanup_region; 308 goto cleanup_region;
@@ -392,7 +394,7 @@ cleanup_region:
392 394
393void unload_uart401(struct address_info *hw_config) 395void unload_uart401(struct address_info *hw_config)
394{ 396{
395 uart401_devc *devc; 397 struct uart401_devc *devc;
396 int n=hw_config->slots[4]; 398 int n=hw_config->slots[4];
397 399
398 /* Not set up */ 400 /* Not set up */