summaryrefslogtreecommitdiff
path: root/drivers/net/sfc/falcon.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-23 19:05:12 +0300
committerDavid S. Miller <davem@davemloft.net>2009-11-24 21:58:42 +0300
commit278c0621fbc4ef52177969edb6f07352da816fdb (patch)
tree1af11fc3f69948a0687df279255c754f5671bd99 /drivers/net/sfc/falcon.c
parent981fc1b4b8cc6bfe8c6f0c07052e25738d959c68 (diff)
downloadlinux-278c0621fbc4ef52177969edb6f07352da816fdb.tar.xz
sfc: Make board information explicitly Falcon-specific
Rename struct efx_board to struct falcon_board. Introduce and use inline function to look up board info from struct efx_nic, in preparation for moving it. Move board init and fini calls into NIC probe and remove functions. 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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 865638b035bf..29e79f77b732 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2877,8 +2877,17 @@ int falcon_probe_nic(struct efx_nic *efx)
if (rc)
goto fail5;
+ rc = falcon_board(efx)->init(efx);
+ if (rc) {
+ EFX_ERR(efx, "failed to initialise board\n");
+ goto fail6;
+ }
+
return 0;
+ fail6:
+ BUG_ON(i2c_del_adapter(&efx->i2c_adap));
+ memset(&efx->i2c_adap, 0, sizeof(efx->i2c_adap));
fail5:
falcon_remove_spi_devices(efx);
falcon_free_buffer(efx, &efx->irq_status);
@@ -3070,6 +3079,8 @@ void falcon_remove_nic(struct efx_nic *efx)
struct falcon_nic_data *nic_data = efx->nic_data;
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);
BUG_ON(rc);