diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 16:06:02 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 10:58:52 -0800 |
commit | e775fb93a880d218ce0b3fd405278dd78f86c405 (patch) | |
tree | 5f5c31161f7f11a9611481396de92964e2fdaaae /drivers/net/sfc/falcon.c | |
parent | 3759433db2f7340ddec3abd55ebb1178600d014e (diff) | |
download | linux-e775fb93a880d218ce0b3fd405278dd78f86c405.tar.gz linux-e775fb93a880d218ce0b3fd405278dd78f86c405.tar.bz2 linux-e775fb93a880d218ce0b3fd405278dd78f86c405.zip |
sfc: Move all I2C stuff into struct falcon_board
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 490bda0d010e..ff15b9dd3618 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c @@ -2799,6 +2799,7 @@ static void falcon_probe_spi_devices(struct efx_nic *efx) int falcon_probe_nic(struct efx_nic *efx) { struct falcon_nic_data *nic_data; + struct falcon_board *board; int rc; /* Allocate storage for hardware specific data */ @@ -2856,13 +2857,15 @@ int falcon_probe_nic(struct efx_nic *efx) goto fail5; /* Initialise I2C adapter */ - efx->i2c_adap.owner = THIS_MODULE; - nic_data->i2c_data = falcon_i2c_bit_operations; - nic_data->i2c_data.data = efx; - efx->i2c_adap.algo_data = &nic_data->i2c_data; - efx->i2c_adap.dev.parent = &efx->pci_dev->dev; - strlcpy(efx->i2c_adap.name, "SFC4000 GPIO", sizeof(efx->i2c_adap.name)); - rc = i2c_bit_add_bus(&efx->i2c_adap); + board = falcon_board(efx); + board->i2c_adap.owner = THIS_MODULE; + board->i2c_data = falcon_i2c_bit_operations; + board->i2c_data.data = efx; + board->i2c_adap.algo_data = &board->i2c_data; + board->i2c_adap.dev.parent = &efx->pci_dev->dev; + strlcpy(board->i2c_adap.name, "SFC4000 GPIO", + sizeof(board->i2c_adap.name)); + rc = i2c_bit_add_bus(&board->i2c_adap); if (rc) goto fail5; @@ -2875,8 +2878,8 @@ int falcon_probe_nic(struct efx_nic *efx) return 0; fail6: - BUG_ON(i2c_del_adapter(&efx->i2c_adap)); - memset(&efx->i2c_adap, 0, sizeof(efx->i2c_adap)); + BUG_ON(i2c_del_adapter(&board->i2c_adap)); + memset(&board->i2c_adap, 0, sizeof(board->i2c_adap)); fail5: falcon_remove_spi_devices(efx); falcon_free_buffer(efx, &efx->irq_status); @@ -3066,14 +3069,15 @@ int falcon_init_nic(struct efx_nic *efx) void falcon_remove_nic(struct efx_nic *efx) { struct falcon_nic_data *nic_data = efx->nic_data; + struct falcon_board *board = falcon_board(efx); int rc; falcon_board(efx)->fini(efx); /* Remove I2C adapter and clear it in preparation for a retry */ - rc = i2c_del_adapter(&efx->i2c_adap); + rc = i2c_del_adapter(&board->i2c_adap); BUG_ON(rc); - memset(&efx->i2c_adap, 0, sizeof(efx->i2c_adap)); + memset(&board->i2c_adap, 0, sizeof(board->i2c_adap)); falcon_remove_spi_devices(efx); falcon_free_buffer(efx, &efx->irq_status); |