dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Thomas Klein 2007-08-06 13:55:14 +02:00 committed by Jeff Garzik
parent f46f6ba99b
commit 35cf2e2e3b
1 changed files with 6 additions and 12 deletions

View File

@ -2165,24 +2165,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
return ret;
}
static void ehea_remove_adapter_mr (struct ehea_adapter *adapter)
static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
{
int i;
for (i=0; i < EHEA_MAX_PORTS; i++)
if (adapter->port[i])
return;
if (adapter->active_ports)
return;
ehea_rem_mr(&adapter->mr);
}
static int ehea_add_adapter_mr (struct ehea_adapter *adapter)
static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
{
int i;
for (i=0; i < EHEA_MAX_PORTS; i++)
if (adapter->port[i])
return 0;
if (adapter->active_ports)
return 0;
return ehea_reg_kernel_mr(adapter, &adapter->mr);
}