Skip to content

Commit e473ee2

Browse files
Michael Rubingregkh
authored andcommitted
staging: gpib: tms9914: struct gpib_board
Using Linux code style for struct gpib_board. Adhering to Linux code style. In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin <[email protected]> Acked-By: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1d61a41 commit e473ee2

File tree

2 files changed

+59
-59
lines changed

2 files changed

+59
-59
lines changed

drivers/staging/gpib/include/tms9914.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 */
1+
//* SPDX-License-Identifier: GPL-2.0 */
22

33
/***************************************************************************
44
* copyright : (C) 2002 by Frank Mori Hess
@@ -79,47 +79,47 @@ enum {
7979
};
8080

8181
// interface functions
82-
int tms9914_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
82+
int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
8383
size_t length, int *end, size_t *bytes_read);
84-
int tms9914_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
84+
int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
8585
size_t length, int send_eoi, size_t *bytes_written);
86-
int tms9914_command(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
86+
int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
8787
size_t length, size_t *bytes_written);
88-
int tms9914_take_control(gpib_board_t *board, struct tms9914_priv *priv, int syncronous);
88+
int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, int syncronous);
8989
/* alternate version of tms9914_take_control which works around buggy tcs
9090
* implementation.
9191
*/
92-
int tms9914_take_control_workaround(gpib_board_t *board, struct tms9914_priv *priv,
92+
int tms9914_take_control_workaround(struct gpib_board *board, struct tms9914_priv *priv,
9393
int syncronous);
94-
int tms9914_go_to_standby(gpib_board_t *board, struct tms9914_priv *priv);
95-
void tms9914_request_system_control(gpib_board_t *board, struct tms9914_priv *priv,
94+
int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *priv);
95+
void tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv,
9696
int request_control);
97-
void tms9914_interface_clear(gpib_board_t *board, struct tms9914_priv *priv, int assert);
98-
void tms9914_remote_enable(gpib_board_t *board, struct tms9914_priv *priv, int enable);
99-
int tms9914_enable_eos(gpib_board_t *board, struct tms9914_priv *priv, uint8_t eos_bytes,
97+
void tms9914_interface_clear(struct gpib_board *board, struct tms9914_priv *priv, int assert);
98+
void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *priv, int enable);
99+
int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, uint8_t eos_bytes,
100100
int compare_8_bits);
101-
void tms9914_disable_eos(gpib_board_t *board, struct tms9914_priv *priv);
102-
unsigned int tms9914_update_status(gpib_board_t *board, struct tms9914_priv *priv,
101+
void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *priv);
102+
unsigned int tms9914_update_status(struct gpib_board *board, struct tms9914_priv *priv,
103103
unsigned int clear_mask);
104-
int tms9914_primary_address(gpib_board_t *board,
104+
int tms9914_primary_address(struct gpib_board *board,
105105
struct tms9914_priv *priv, unsigned int address);
106-
int tms9914_secondary_address(gpib_board_t *board, struct tms9914_priv *priv,
106+
int tms9914_secondary_address(struct gpib_board *board, struct tms9914_priv *priv,
107107
unsigned int address, int enable);
108-
int tms9914_parallel_poll(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *result);
109-
void tms9914_parallel_poll_configure(gpib_board_t *board,
108+
int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *result);
109+
void tms9914_parallel_poll_configure(struct gpib_board *board,
110110
struct tms9914_priv *priv, uint8_t config);
111-
void tms9914_parallel_poll_response(gpib_board_t *board,
111+
void tms9914_parallel_poll_response(struct gpib_board *board,
112112
struct tms9914_priv *priv, int ist);
113-
void tms9914_serial_poll_response(gpib_board_t *board, struct tms9914_priv *priv, uint8_t status);
114-
uint8_t tms9914_serial_poll_status(gpib_board_t *board, struct tms9914_priv *priv);
115-
int tms9914_line_status(const gpib_board_t *board, struct tms9914_priv *priv);
116-
unsigned int tms9914_t1_delay(gpib_board_t *board, struct tms9914_priv *priv,
113+
void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914_priv *priv, uint8_t status);
114+
uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv);
115+
int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *priv);
116+
unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_priv *priv,
117117
unsigned int nano_sec);
118-
void tms9914_return_to_local(const gpib_board_t *board, struct tms9914_priv *priv);
118+
void tms9914_return_to_local(const struct gpib_board *board, struct tms9914_priv *priv);
119119

120120
// utility functions
121121
void tms9914_board_reset(struct tms9914_priv *priv);
122-
void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv);
122+
void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv);
123123
void tms9914_release_holdoff(struct tms9914_priv *priv);
124124
void tms9914_set_holdoff_mode(struct tms9914_priv *priv, enum tms9914_holdoff_mode mode);
125125

@@ -130,8 +130,8 @@ uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register
130130
void tms9914_iomem_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num);
131131

132132
// interrupt service routine
133-
irqreturn_t tms9914_interrupt(gpib_board_t *board, struct tms9914_priv *priv);
134-
irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9914_priv *priv,
133+
irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_priv *priv);
134+
irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms9914_priv *priv,
135135
int status1, int status2);
136136

137137
// tms9914 has 8 registers

drivers/staging/gpib/tms9914/tms9914.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
MODULE_LICENSE("GPL");
2828
MODULE_DESCRIPTION("GPIB library for tms9914");
2929

30-
static unsigned int update_status_nolock(gpib_board_t *board, struct tms9914_priv *priv);
30+
static unsigned int update_status_nolock(struct gpib_board *board, struct tms9914_priv *priv);
3131

32-
int tms9914_take_control(gpib_board_t *board, struct tms9914_priv *priv, int synchronous)
32+
int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, int synchronous)
3333
{
3434
int i;
3535
const int timeout = 100;
@@ -66,15 +66,15 @@ EXPORT_SYMBOL_GPL(tms9914_take_control);
6666
* The rest of the tms9914 based drivers still use tms9914_take_control
6767
* directly (which does issue tcs).
6868
*/
69-
int tms9914_take_control_workaround(gpib_board_t *board, struct tms9914_priv *priv, int synchronous)
69+
int tms9914_take_control_workaround(struct gpib_board *board, struct tms9914_priv *priv, int synchronous)
7070
{
7171
if (synchronous)
7272
return -ETIMEDOUT;
7373
return tms9914_take_control(board, priv, synchronous);
7474
}
7575
EXPORT_SYMBOL_GPL(tms9914_take_control_workaround);
7676

77-
int tms9914_go_to_standby(gpib_board_t *board, struct tms9914_priv *priv)
77+
int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *priv)
7878
{
7979
int i;
8080
const int timeout = 1000;
@@ -95,7 +95,7 @@ int tms9914_go_to_standby(gpib_board_t *board, struct tms9914_priv *priv)
9595
}
9696
EXPORT_SYMBOL_GPL(tms9914_go_to_standby);
9797

98-
void tms9914_interface_clear(gpib_board_t *board, struct tms9914_priv *priv, int assert)
98+
void tms9914_interface_clear(struct gpib_board *board, struct tms9914_priv *priv, int assert)
9999
{
100100
if (assert) {
101101
write_byte(priv, AUX_SIC | AUX_CS, AUXCR);
@@ -107,7 +107,7 @@ void tms9914_interface_clear(gpib_board_t *board, struct tms9914_priv *priv, int
107107
}
108108
EXPORT_SYMBOL_GPL(tms9914_interface_clear);
109109

110-
void tms9914_remote_enable(gpib_board_t *board, struct tms9914_priv *priv, int enable)
110+
void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *priv, int enable)
111111
{
112112
if (enable)
113113
write_byte(priv, AUX_SRE | AUX_CS, AUXCR);
@@ -116,7 +116,7 @@ void tms9914_remote_enable(gpib_board_t *board, struct tms9914_priv *priv, int e
116116
}
117117
EXPORT_SYMBOL_GPL(tms9914_remote_enable);
118118

119-
void tms9914_request_system_control(gpib_board_t *board, struct tms9914_priv *priv,
119+
void tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv,
120120
int request_control)
121121
{
122122
if (request_control) {
@@ -128,7 +128,7 @@ void tms9914_request_system_control(gpib_board_t *board, struct tms9914_priv *pr
128128
}
129129
EXPORT_SYMBOL_GPL(tms9914_request_system_control);
130130

131-
unsigned int tms9914_t1_delay(gpib_board_t *board, struct tms9914_priv *priv,
131+
unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_priv *priv,
132132
unsigned int nano_sec)
133133
{
134134
static const int clock_period = 200; // assuming 5Mhz input clock
@@ -154,7 +154,7 @@ unsigned int tms9914_t1_delay(gpib_board_t *board, struct tms9914_priv *priv,
154154
}
155155
EXPORT_SYMBOL_GPL(tms9914_t1_delay);
156156

157-
void tms9914_return_to_local(const gpib_board_t *board, struct tms9914_priv *priv)
157+
void tms9914_return_to_local(const struct gpib_board *board, struct tms9914_priv *priv)
158158
{
159159
write_byte(priv, AUX_RTL, AUXCR);
160160
}
@@ -192,7 +192,7 @@ void tms9914_release_holdoff(struct tms9914_priv *priv)
192192
}
193193
EXPORT_SYMBOL_GPL(tms9914_release_holdoff);
194194

195-
int tms9914_enable_eos(gpib_board_t *board, struct tms9914_priv *priv, uint8_t eos_byte,
195+
int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, uint8_t eos_byte,
196196
int compare_8_bits)
197197
{
198198
priv->eos = eos_byte;
@@ -203,13 +203,13 @@ int tms9914_enable_eos(gpib_board_t *board, struct tms9914_priv *priv, uint8_t e
203203
}
204204
EXPORT_SYMBOL(tms9914_enable_eos);
205205

206-
void tms9914_disable_eos(gpib_board_t *board, struct tms9914_priv *priv)
206+
void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *priv)
207207
{
208208
priv->eos_flags &= ~REOS;
209209
}
210210
EXPORT_SYMBOL(tms9914_disable_eos);
211211

212-
int tms9914_parallel_poll(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *result)
212+
int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *result)
213213
{
214214
// execute parallel poll
215215
write_byte(priv, AUX_CS | AUX_RPP, AUXCR);
@@ -234,7 +234,7 @@ static void set_ppoll_reg(struct tms9914_priv *priv, int enable,
234234
}
235235
}
236236

237-
void tms9914_parallel_poll_configure(gpib_board_t *board,
237+
void tms9914_parallel_poll_configure(struct gpib_board *board,
238238
struct tms9914_priv *priv, uint8_t config)
239239
{
240240
priv->ppoll_enable = (config & PPC_DISABLE) == 0;
@@ -244,14 +244,14 @@ void tms9914_parallel_poll_configure(gpib_board_t *board,
244244
}
245245
EXPORT_SYMBOL(tms9914_parallel_poll_configure);
246246

247-
void tms9914_parallel_poll_response(gpib_board_t *board,
247+
void tms9914_parallel_poll_response(struct gpib_board *board,
248248
struct tms9914_priv *priv, int ist)
249249
{
250250
set_ppoll_reg(priv, priv->ppoll_enable, priv->ppoll_line, priv->ppoll_sense, ist);
251251
}
252252
EXPORT_SYMBOL(tms9914_parallel_poll_response);
253253

254-
void tms9914_serial_poll_response(gpib_board_t *board, struct tms9914_priv *priv, uint8_t status)
254+
void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914_priv *priv, uint8_t status)
255255
{
256256
unsigned long flags;
257257

@@ -266,7 +266,7 @@ void tms9914_serial_poll_response(gpib_board_t *board, struct tms9914_priv *priv
266266
}
267267
EXPORT_SYMBOL(tms9914_serial_poll_response);
268268

269-
uint8_t tms9914_serial_poll_status(gpib_board_t *board, struct tms9914_priv *priv)
269+
uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv)
270270
{
271271
u8 status;
272272
unsigned long flags;
@@ -279,15 +279,15 @@ uint8_t tms9914_serial_poll_status(gpib_board_t *board, struct tms9914_priv *pri
279279
}
280280
EXPORT_SYMBOL(tms9914_serial_poll_status);
281281

282-
int tms9914_primary_address(gpib_board_t *board, struct tms9914_priv *priv, unsigned int address)
282+
int tms9914_primary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address)
283283
{
284284
// put primary address in address0
285285
write_byte(priv, address & ADDRESS_MASK, ADR);
286286
return 0;
287287
}
288288
EXPORT_SYMBOL(tms9914_primary_address);
289289

290-
int tms9914_secondary_address(gpib_board_t *board, struct tms9914_priv *priv,
290+
int tms9914_secondary_address(struct gpib_board *board, struct tms9914_priv *priv,
291291
unsigned int address, int enable)
292292
{
293293
if (enable)
@@ -300,7 +300,7 @@ int tms9914_secondary_address(gpib_board_t *board, struct tms9914_priv *priv,
300300
}
301301
EXPORT_SYMBOL(tms9914_secondary_address);
302302

303-
unsigned int tms9914_update_status(gpib_board_t *board, struct tms9914_priv *priv,
303+
unsigned int tms9914_update_status(struct gpib_board *board, struct tms9914_priv *priv,
304304
unsigned int clear_mask)
305305
{
306306
unsigned long flags;
@@ -342,7 +342,7 @@ static void update_listener_state(struct tms9914_priv *priv, unsigned int addres
342342
}
343343
}
344344

345-
static unsigned int update_status_nolock(gpib_board_t *board, struct tms9914_priv *priv)
345+
static unsigned int update_status_nolock(struct gpib_board *board, struct tms9914_priv *priv)
346346
{
347347
int address_status;
348348
int bsr_bits;
@@ -388,7 +388,7 @@ static unsigned int update_status_nolock(gpib_board_t *board, struct tms9914_pri
388388
return board->status;
389389
}
390390

391-
int tms9914_line_status(const gpib_board_t *board, struct tms9914_priv *priv)
391+
int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *priv)
392392
{
393393
int bsr_bits;
394394
int status = VALID_ALL;
@@ -433,7 +433,7 @@ static int check_for_eos(struct tms9914_priv *priv, uint8_t byte)
433433
return 0;
434434
}
435435

436-
static int wait_for_read_byte(gpib_board_t *board, struct tms9914_priv *priv)
436+
static int wait_for_read_byte(struct gpib_board *board, struct tms9914_priv *priv)
437437
{
438438
if (wait_event_interruptible(board->wait,
439439
test_bit(READ_READY_BN, &priv->state) ||
@@ -449,7 +449,7 @@ static int wait_for_read_byte(gpib_board_t *board, struct tms9914_priv *priv)
449449
return 0;
450450
}
451451

452-
static inline uint8_t tms9914_read_data_in(gpib_board_t *board, struct tms9914_priv *priv, int *end)
452+
static inline uint8_t tms9914_read_data_in(struct gpib_board *board, struct tms9914_priv *priv, int *end)
453453
{
454454
unsigned long flags;
455455
u8 data;
@@ -480,7 +480,7 @@ static inline uint8_t tms9914_read_data_in(gpib_board_t *board, struct tms9914_p
480480
return data;
481481
}
482482

483-
static int pio_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
483+
static int pio_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
484484
size_t length, int *end, size_t *bytes_read)
485485
{
486486
ssize_t retval = 0;
@@ -501,7 +501,7 @@ static int pio_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buf
501501
return retval;
502502
}
503503

504-
int tms9914_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
504+
int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
505505
size_t length, int *end, size_t *bytes_read)
506506
{
507507
ssize_t retval = 0;
@@ -541,7 +541,7 @@ int tms9914_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer
541541
}
542542
EXPORT_SYMBOL(tms9914_read);
543543

544-
static int pio_write_wait(gpib_board_t *board, struct tms9914_priv *priv)
544+
static int pio_write_wait(struct gpib_board *board, struct tms9914_priv *priv)
545545
{
546546
// wait until next byte is ready to be sent
547547
if (wait_event_interruptible(board->wait,
@@ -561,7 +561,7 @@ static int pio_write_wait(gpib_board_t *board, struct tms9914_priv *priv)
561561
return 0;
562562
}
563563

564-
static int pio_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
564+
static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
565565
size_t length, size_t *bytes_written)
566566
{
567567
ssize_t retval = 0;
@@ -585,7 +585,7 @@ static int pio_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *bu
585585
return length;
586586
}
587587

588-
int tms9914_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer, size_t length,
588+
int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, size_t length,
589589
int send_eoi, size_t *bytes_written)
590590
{
591591
ssize_t retval = 0;
@@ -620,7 +620,7 @@ int tms9914_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffe
620620
}
621621
EXPORT_SYMBOL(tms9914_write);
622622

623-
static void check_my_address_state(gpib_board_t *board, struct tms9914_priv *priv, int cmd_byte)
623+
static void check_my_address_state(struct gpib_board *board, struct tms9914_priv *priv, int cmd_byte)
624624
{
625625
if (cmd_byte == MLA(board->pad)) {
626626
priv->primary_listen_addressed = 1;
@@ -655,7 +655,7 @@ static void check_my_address_state(gpib_board_t *board, struct tms9914_priv *pri
655655
}
656656
}
657657

658-
int tms9914_command(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *buffer,
658+
int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer,
659659
size_t length, size_t *bytes_written)
660660
{
661661
int retval = 0;
@@ -692,7 +692,7 @@ int tms9914_command(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *bu
692692
}
693693
EXPORT_SYMBOL(tms9914_command);
694694

695-
irqreturn_t tms9914_interrupt(gpib_board_t *board, struct tms9914_priv *priv)
695+
irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_priv *priv)
696696
{
697697
int status0, status1;
698698

@@ -703,7 +703,7 @@ irqreturn_t tms9914_interrupt(gpib_board_t *board, struct tms9914_priv *priv)
703703
}
704704
EXPORT_SYMBOL(tms9914_interrupt);
705705

706-
irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9914_priv *priv,
706+
irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms9914_priv *priv,
707707
int status0, int status1)
708708
{
709709
// record reception of END
@@ -837,7 +837,7 @@ void tms9914_board_reset(struct tms9914_priv *priv)
837837
}
838838
EXPORT_SYMBOL_GPL(tms9914_board_reset);
839839

840-
void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv)
840+
void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv)
841841
{
842842
/* set GPIB address */
843843
tms9914_primary_address(board, priv, board->pad);

0 commit comments

Comments
 (0)