[PATCH v1 05/20] staging: gpib: cec_gpib: struct gpib_board

Michael Rubin
2025-03-19T21:59:43Z

drivers/staging/gpib/cec/cec_gpib.c | 59 +++++++++++++++--------------
1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c
index 8f2b4b46a446..abe5b1b8bc5b 100644
--- a/drivers/staging/gpib/cec/cec_gpib.c
+++ b/drivers/staging/gpib/cec/cec_gpib.c
@@ -25,7 +25,7 @@ MODULE_DESCRIPTION("GPIB driver for CEC PCI and PCMCIA boards");

static irqreturn_t cec_interrupt(int irq, void *arg)
{
- gpib_board_t *board = arg;
+ struct gpib_board *board = arg;
struct cec_priv *priv = board->private_data;
unsigned long flags;
irqreturn_t retval;
@@ -40,12 +40,12 @@ static irqreturn_t cec_interrupt(int irq, void *arg)
#define CEC_DEV_ID 0x5cec
#define CEC_SUBID 0x9050

-static int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *config);
+static int cec_pci_attach(struct gpib_board *board, const gpib_board_config_t *config);

-static void cec_pci_detach(gpib_board_t *board);
+static void cec_pci_detach(struct gpib_board *board);

// wrappers for interface functions
-static int cec_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end,
+static int cec_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end,
size_t *bytes_read)
{
struct cec_priv *priv = board->private_data;
@@ -53,7 +53,7 @@ static int cec_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 cec_write(gpib_board_t *board, uint8_t *buffer, size_t length, int send_eoi,
+static int cec_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi,
size_t *bytes_written)
{
struct cec_priv *priv = board->private_data;
@@ -61,126 +61,127 @@ static int cec_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 cec_command(gpib_board_t *board, uint8_t *buffer, size_t length, size_t *bytes_written)
+static int cec_command(struct gpib_board *board, uint8_t *buffer,
+ size_t length, size_t *bytes_written)
{
struct cec_priv *priv = board->private_data;

return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written);
}

-static int cec_take_control(gpib_board_t *board, int synchronous)
+static int cec_take_control(struct gpib_board *board, int synchronous)
{
struct cec_priv *priv = board->private_data;

return nec7210_take_control(board, &priv->nec7210_priv, synchronous);
}

-static int cec_go_to_standby(gpib_board_t *board)
+static int cec_go_to_standby(struct gpib_board *board)
{
struct cec_priv *priv = board->private_data;

return nec7210_go_to_standby(board, &priv->nec7210_priv);
}

-static void cec_request_system_control(gpib_board_t *board, int request_control)
+static void cec_request_system_control(struct gpib_board *board, int request_control)
{
struct cec_priv *priv = board->private_data;

nec7210_request_system_control(board, &priv->nec7210_priv, request_control);
}

-static void cec_interface_clear(gpib_board_t *board, int assert)
+static void cec_interface_clear(struct gpib_board *board, int assert)
{
struct cec_priv *priv = board->private_data;

nec7210_interface_clear(board, &priv->nec7210_priv, assert);
}

-static void cec_remote_enable(gpib_board_t *board, int enable)
+static void cec_remote_enable(struct gpib_board *board, int enable)
{
struct cec_priv *priv = board->private_data;

nec7210_remote_enable(board, &priv->nec7210_priv, enable);
}

-static int cec_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compare_8_bits)
+static int cec_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits)
{
struct cec_priv *priv = board->private_data;

return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits);
}

-static void cec_disable_eos(gpib_board_t *board)
+static void cec_disable_eos(struct gpib_board *board)
{
struct cec_priv *priv = board->private_data;

nec7210_disable_eos(board, &priv->nec7210_priv);
}

-static unsigned int cec_update_status(gpib_board_t *board, unsigned int clear_mask)
+static unsigned int cec_update_status(struct gpib_board *board, unsigned int clear_mask)
{
struct cec_priv *priv = board->private_data;

return nec7210_update_status(board, &priv->nec7210_priv, clear_mask);
}

-static int cec_primary_address(gpib_board_t *board, unsigned int address)
+static int cec_primary_address(struct gpib_board *board, unsigned int address)
{
struct cec_priv *priv = board->private_data;

return nec7210_primary_address(board, &priv->nec7210_priv, address);
}

-static int cec_secondary_address(gpib_board_t *board, unsigned int address, int enable)
+static int cec_secondary_address(struct gpib_board *board, unsigned int address, int enable)
{
struct cec_priv *priv = board->private_data;

return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable);
}

-static int cec_parallel_poll(gpib_board_t *board, uint8_t *result)
+static int cec_parallel_poll(struct gpib_board *board, uint8_t *result)
{
struct cec_priv *priv = board->private_data;

return nec7210_parallel_poll(board, &priv->nec7210_priv, result);
}

-static void cec_parallel_poll_configure(gpib_board_t *board, uint8_t config)
+static void cec_parallel_poll_configure(struct gpib_board *board, uint8_t config)
{
struct cec_priv *priv = board->private_data;

nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config);
}

-static void cec_parallel_poll_response(gpib_board_t *board, int ist)
+static void cec_parallel_poll_response(struct gpib_board *board, int ist)
{
struct cec_priv *priv = board->private_data;

nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist);
}

-static void cec_serial_poll_response(gpib_board_t *board, uint8_t status)
+static void cec_serial_poll_response(struct gpib_board *board, uint8_t status)
{
struct cec_priv *priv = board->private_data;

nec7210_serial_poll_response(board, &priv->nec7210_priv, status);
}

-static uint8_t cec_serial_poll_status(gpib_board_t *board)
+static uint8_t cec_serial_poll_status(struct gpib_board *board)
{
struct cec_priv *priv = board->private_data;

return nec7210_serial_poll_status(board, &priv->nec7210_priv);
}

-static unsigned int cec_t1_delay(gpib_board_t *board, unsigned int nano_sec)
+static unsigned int cec_t1_delay(struct gpib_board *board, unsigned int nano_sec)
{
struct cec_priv *priv = board->private_data;

return nec7210_t1_delay(board, &priv->nec7210_priv, nano_sec);
}

-static void cec_return_to_local(gpib_board_t *board)
+static void cec_return_to_local(struct gpib_board *board)
{
struct cec_priv *priv = board->private_data;

@@ -215,7 +216,7 @@ static gpib_interface_t cec_pci_interface = {
.return_to_local = cec_return_to_local,
};

-static int cec_allocate_private(gpib_board_t *board)
+static int cec_allocate_private(struct gpib_board *board)
{
struct cec_priv *priv;

@@ -228,13 +229,13 @@ static int cec_allocate_private(gpib_board_t *board)
return 0;
}

-static void cec_free_private(gpib_board_t *board)
+static void cec_free_private(struct gpib_board *board)
{
kfree(board->private_data);
board->private_data = NULL;
}

-static int cec_generic_attach(gpib_board_t *board)
+static int cec_generic_attach(struct gpib_board *board)
{
struct cec_priv *cec_priv;
struct nec7210_priv *nec_priv;
@@ -252,7 +253,7 @@ static int cec_generic_attach(gpib_board_t *board)
return 0;
}

-static void cec_init(struct cec_priv *cec_priv, const gpib_board_t *board)
+static void cec_init(struct cec_priv *cec_priv, const struct gpib_board *board)
{
struct nec7210_priv *nec_priv = &cec_priv->nec7210_priv;

@@ -264,7 +265,7 @@ static void cec_init(struct cec_priv *cec_priv, const gpib_board_t *board)
nec7210_board_online(nec_priv, board);
}

-static int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *config)
+static int cec_pci_attach(struct gpib_board *board, const gpib_board_config_t *config)
{
struct cec_priv *cec_priv;
struct nec7210_priv *nec_priv;
@@ -322,7 +323,7 @@ static int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *config
return 0;
}

-static void cec_pci_detach(gpib_board_t *board)
+static void cec_pci_detach(struct gpib_board *board)
{
struct cec_priv *cec_priv = board->private_data;
struct nec7210_priv *nec_priv;
--
2.43.0