mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 15:08:25 -04:00
staging: gpib: pc2: 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 <matchstick@neverthere.org> Acked-By: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250319215924.19387-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f3ac015f4c
commit
1d61a41b3b
@@ -58,7 +58,7 @@ MODULE_DESCRIPTION("GPIB driver for PC2/PC2a and compatible devices");
|
||||
|
||||
irqreturn_t pc2_interrupt(int irq, void *arg)
|
||||
{
|
||||
gpib_board_t *board = arg;
|
||||
struct gpib_board *board = arg;
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
unsigned long flags;
|
||||
irqreturn_t retval;
|
||||
@@ -71,7 +71,7 @@ irqreturn_t pc2_interrupt(int irq, void *arg)
|
||||
|
||||
irqreturn_t pc2a_interrupt(int irq, void *arg)
|
||||
{
|
||||
gpib_board_t *board = arg;
|
||||
struct gpib_board *board = arg;
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
int status1, status2;
|
||||
unsigned long flags;
|
||||
@@ -90,7 +90,7 @@ irqreturn_t pc2a_interrupt(int irq, void *arg)
|
||||
}
|
||||
|
||||
// wrappers for interface functions
|
||||
static int pc2_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end,
|
||||
static int pc2_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end,
|
||||
size_t *bytes_read)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
@@ -98,7 +98,7 @@ static int pc2_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *en
|
||||
return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read);
|
||||
}
|
||||
|
||||
static int pc2_write(gpib_board_t *board, uint8_t *buffer, size_t length, int send_eoi,
|
||||
static int pc2_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi,
|
||||
size_t *bytes_written)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
@@ -106,133 +106,133 @@ static int pc2_write(gpib_board_t *board, uint8_t *buffer, size_t length, int se
|
||||
return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written);
|
||||
}
|
||||
|
||||
static int pc2_command(gpib_board_t *board, uint8_t *buffer, size_t length, size_t *bytes_written)
|
||||
static int pc2_command(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written);
|
||||
}
|
||||
|
||||
static int pc2_take_control(gpib_board_t *board, int synchronous)
|
||||
static int pc2_take_control(struct gpib_board *board, int synchronous)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_take_control(board, &priv->nec7210_priv, synchronous);
|
||||
}
|
||||
|
||||
static int pc2_go_to_standby(gpib_board_t *board)
|
||||
static int pc2_go_to_standby(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_go_to_standby(board, &priv->nec7210_priv);
|
||||
}
|
||||
|
||||
static void pc2_request_system_control(gpib_board_t *board, int request_control)
|
||||
static void pc2_request_system_control(struct gpib_board *board, int request_control)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_request_system_control(board, &priv->nec7210_priv, request_control);
|
||||
}
|
||||
|
||||
static void pc2_interface_clear(gpib_board_t *board, int assert)
|
||||
static void pc2_interface_clear(struct gpib_board *board, int assert)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_interface_clear(board, &priv->nec7210_priv, assert);
|
||||
}
|
||||
|
||||
static void pc2_remote_enable(gpib_board_t *board, int enable)
|
||||
static void pc2_remote_enable(struct gpib_board *board, int enable)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_remote_enable(board, &priv->nec7210_priv, enable);
|
||||
}
|
||||
|
||||
static int pc2_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compare_8_bits)
|
||||
static int pc2_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits);
|
||||
}
|
||||
|
||||
static void pc2_disable_eos(gpib_board_t *board)
|
||||
static void pc2_disable_eos(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_disable_eos(board, &priv->nec7210_priv);
|
||||
}
|
||||
|
||||
static unsigned int pc2_update_status(gpib_board_t *board, unsigned int clear_mask)
|
||||
static unsigned int pc2_update_status(struct gpib_board *board, unsigned int clear_mask)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_update_status(board, &priv->nec7210_priv, clear_mask);
|
||||
}
|
||||
|
||||
static int pc2_primary_address(gpib_board_t *board, unsigned int address)
|
||||
static int pc2_primary_address(struct gpib_board *board, unsigned int address)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_primary_address(board, &priv->nec7210_priv, address);
|
||||
}
|
||||
|
||||
static int pc2_secondary_address(gpib_board_t *board, unsigned int address, int enable)
|
||||
static int pc2_secondary_address(struct gpib_board *board, unsigned int address, int enable)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable);
|
||||
}
|
||||
|
||||
static int pc2_parallel_poll(gpib_board_t *board, uint8_t *result)
|
||||
static int pc2_parallel_poll(struct gpib_board *board, uint8_t *result)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_parallel_poll(board, &priv->nec7210_priv, result);
|
||||
}
|
||||
|
||||
static void pc2_parallel_poll_configure(gpib_board_t *board, uint8_t config)
|
||||
static void pc2_parallel_poll_configure(struct gpib_board *board, uint8_t config)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config);
|
||||
}
|
||||
|
||||
static void pc2_parallel_poll_response(gpib_board_t *board, int ist)
|
||||
static void pc2_parallel_poll_response(struct gpib_board *board, int ist)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist);
|
||||
}
|
||||
|
||||
static void pc2_serial_poll_response(gpib_board_t *board, uint8_t status)
|
||||
static void pc2_serial_poll_response(struct gpib_board *board, uint8_t status)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_serial_poll_response(board, &priv->nec7210_priv, status);
|
||||
}
|
||||
|
||||
static uint8_t pc2_serial_poll_status(gpib_board_t *board)
|
||||
static uint8_t pc2_serial_poll_status(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_serial_poll_status(board, &priv->nec7210_priv);
|
||||
}
|
||||
|
||||
static unsigned int pc2_t1_delay(gpib_board_t *board, unsigned int nano_sec)
|
||||
static unsigned int pc2_t1_delay(struct gpib_board *board, unsigned int nano_sec)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
return nec7210_t1_delay(board, &priv->nec7210_priv, nano_sec);
|
||||
}
|
||||
|
||||
static void pc2_return_to_local(gpib_board_t *board)
|
||||
static void pc2_return_to_local(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *priv = board->private_data;
|
||||
|
||||
nec7210_return_to_local(board, &priv->nec7210_priv);
|
||||
}
|
||||
|
||||
static int allocate_private(gpib_board_t *board)
|
||||
static int allocate_private(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *priv;
|
||||
|
||||
@@ -245,13 +245,13 @@ static int allocate_private(gpib_board_t *board)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_private(gpib_board_t *board)
|
||||
static void free_private(struct gpib_board *board)
|
||||
{
|
||||
kfree(board->private_data);
|
||||
board->private_data = NULL;
|
||||
}
|
||||
|
||||
static int pc2_generic_attach(gpib_board_t *board, const gpib_board_config_t *config,
|
||||
static int pc2_generic_attach(struct gpib_board *board, const gpib_board_config_t *config,
|
||||
enum nec7210_chipset chipset)
|
||||
{
|
||||
struct pc2_priv *pc2_priv;
|
||||
@@ -294,7 +294,7 @@ static int pc2_generic_attach(gpib_board_t *board, const gpib_board_config_t *co
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pc2_attach(gpib_board_t *board, const gpib_board_config_t *config)
|
||||
static int pc2_attach(struct gpib_board *board, const gpib_board_config_t *config)
|
||||
{
|
||||
int isr_flags = 0;
|
||||
struct pc2_priv *pc2_priv;
|
||||
@@ -338,7 +338,7 @@ static int pc2_attach(gpib_board_t *board, const gpib_board_config_t *config)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pc2_detach(gpib_board_t *board)
|
||||
static void pc2_detach(struct gpib_board *board)
|
||||
{
|
||||
struct pc2_priv *pc2_priv = board->private_data;
|
||||
struct nec7210_priv *nec_priv;
|
||||
@@ -365,7 +365,7 @@ static void pc2_detach(gpib_board_t *board)
|
||||
free_private(board);
|
||||
}
|
||||
|
||||
static int pc2a_common_attach(gpib_board_t *board, const gpib_board_config_t *config,
|
||||
static int pc2a_common_attach(struct gpib_board *board, const gpib_board_config_t *config,
|
||||
unsigned int num_registers, enum nec7210_chipset chipset)
|
||||
{
|
||||
unsigned int i, j;
|
||||
@@ -459,22 +459,22 @@ static int pc2a_common_attach(gpib_board_t *board, const gpib_board_config_t *co
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pc2a_attach(gpib_board_t *board, const gpib_board_config_t *config)
|
||||
static int pc2a_attach(struct gpib_board *board, const gpib_board_config_t *config)
|
||||
{
|
||||
return pc2a_common_attach(board, config, pc2a_iosize, NEC7210);
|
||||
}
|
||||
|
||||
static int pc2a_cb7210_attach(gpib_board_t *board, const gpib_board_config_t *config)
|
||||
static int pc2a_cb7210_attach(struct gpib_board *board, const gpib_board_config_t *config)
|
||||
{
|
||||
return pc2a_common_attach(board, config, pc2a_iosize, CB7210);
|
||||
}
|
||||
|
||||
static int pc2_2a_attach(gpib_board_t *board, const gpib_board_config_t *config)
|
||||
static int pc2_2a_attach(struct gpib_board *board, const gpib_board_config_t *config)
|
||||
{
|
||||
return pc2a_common_attach(board, config, pc2_2a_iosize, NAT4882);
|
||||
}
|
||||
|
||||
static void pc2a_common_detach(gpib_board_t *board, unsigned int num_registers)
|
||||
static void pc2a_common_detach(struct gpib_board *board, unsigned int num_registers)
|
||||
{
|
||||
int i;
|
||||
struct pc2_priv *pc2_priv = board->private_data;
|
||||
@@ -507,12 +507,12 @@ static void pc2a_common_detach(gpib_board_t *board, unsigned int num_registers)
|
||||
free_private(board);
|
||||
}
|
||||
|
||||
static void pc2a_detach(gpib_board_t *board)
|
||||
static void pc2a_detach(struct gpib_board *board)
|
||||
{
|
||||
pc2a_common_detach(board, pc2a_iosize);
|
||||
}
|
||||
|
||||
static void pc2_2a_detach(gpib_board_t *board)
|
||||
static void pc2_2a_detach(struct gpib_board *board)
|
||||
{
|
||||
pc2a_common_detach(board, pc2_2a_iosize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user