diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-30 16:44:11 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:11 -0400 |
commit | f1b68d4ba40ab327a2aeec1e1fd667d9b9f5d777 (patch) | |
tree | 2a098c8c2737b72e450544348f707d92245b4911 | |
parent | fb8004d39bebfcc8b6b0a4263c712cee5b0f2a54 (diff) |
silicom: get_bypass_slave_pfs() open-codes lookup_port()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/staging/silicom/bp_mod.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/drivers/staging/silicom/bp_mod.c b/drivers/staging/silicom/bp_mod.c index 5392df316fb9..2c7334162c46 100644 --- a/drivers/staging/silicom/bp_mod.c +++ b/drivers/staging/silicom/bp_mod.c @@ -7436,33 +7436,10 @@ get_bypass_slave_pfs(char *page, char **start, off_t off, int count, bpctl_dev_t *pbp_device_block = (bpctl_dev_t *) data; int len = 0; - bpctl_dev_t *pbp_device_block_slave = NULL; - int idx_dev = 0; + bpctl_dev_t *pbp_device_block_slave = get_status_port_fn(pbp_device_block); struct net_device *net_slave_dev = NULL; - if ((pbp_device_block->func == 0) || (pbp_device_block->func == 2)) { - for (idx_dev = 0; - ((bpctl_dev_arr[idx_dev].pdev != NULL) - && (idx_dev < device_num)); idx_dev++) { - if ((bpctl_dev_arr[idx_dev].bus == - pbp_device_block->bus) - && (bpctl_dev_arr[idx_dev].slot == - pbp_device_block->slot)) { - if ((pbp_device_block->func == 0) - && (bpctl_dev_arr[idx_dev].func == 1)) { - pbp_device_block_slave = - &bpctl_dev_arr[idx_dev]; - break; - } - if ((pbp_device_block->func == 2) && - (bpctl_dev_arr[idx_dev].func == 3)) { - pbp_device_block_slave = - &bpctl_dev_arr[idx_dev]; - break; - } - } - } - } else + if (!pbp_device_block_slave) pbp_device_block_slave = pbp_device_block; if (!pbp_device_block_slave) { len = sprintf(page, "fail\n"); |