aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorThomas Klein <osstklei@de.ibm.com>2007-08-06 07:55:14 -0400
committerJeff Garzik <jeff@garzik.org>2007-08-07 17:34:13 -0400
commit35cf2e2e3b96c070a615d699bf514ffec6afd19e (patch)
treeb3e404b42f396c0acdf541005f21a2d99f1cdca0 /drivers/net
parentf46f6ba99bad942963cc4b4cc4aabcc55a567b4a (diff)
ehea: Simplify resource usage check
Use shorter method to determine whether adapter has configured ports Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ehea/ehea_main.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d43ab0f4192a..36ca32275b45 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2165,24 +2165,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
2165 return ret; 2165 return ret;
2166} 2166}
2167 2167
2168static void ehea_remove_adapter_mr (struct ehea_adapter *adapter) 2168static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
2169{ 2169{
2170 int i; 2170 if (adapter->active_ports)
2171 2171 return;
2172 for (i=0; i < EHEA_MAX_PORTS; i++)
2173 if (adapter->port[i])
2174 return;
2175 2172
2176 ehea_rem_mr(&adapter->mr); 2173 ehea_rem_mr(&adapter->mr);
2177} 2174}
2178 2175
2179static int ehea_add_adapter_mr (struct ehea_adapter *adapter) 2176static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
2180{ 2177{
2181 int i; 2178 if (adapter->active_ports)
2182 2179 return 0;
2183 for (i=0; i < EHEA_MAX_PORTS; i++)
2184 if (adapter->port[i])
2185 return 0;
2186 2180
2187 return ehea_reg_kernel_mr(adapter, &adapter->mr); 2181 return ehea_reg_kernel_mr(adapter, &adapter->mr);
2188} 2182}