qeth: fix handling of IPA return codes
authorEugene Crosser <Eugene.Crosser@ru.ibm.com>
Mon, 18 May 2015 12:27:53 +0000 (14:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2015 16:14:17 +0000 (12:14 -0400)
Function that executes IPA commands returns the result code from the
IPA response block. If non-negative, it needs to be transformed into
errno-compatible code before returning to the caller.

Signed-off-by: Eugene Crosser <Eugene.Crosser@ru.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l2_main.c

index 0ea0869120cf4762db9223af4ddd8e78f6f3a1db..1cdefaea866c58d4b4174a924f7133b6d0f1d8dc 100644 (file)
@@ -1808,10 +1808,9 @@ int qeth_bridgeport_query_ports(struct qeth_card *card,
        cmd->data.sbp.hdr.seq_no = 1;
        rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_ports_cb,
                                (void *)&cbctl);
-       if (rc)
+       if (rc < 0)
                return rc;
-       rc = qeth_bridgeport_makerc(card, &cbctl, IPA_SBP_QUERY_BRIDGE_PORTS);
-       return rc;
+       return qeth_bridgeport_makerc(card, &cbctl, IPA_SBP_QUERY_BRIDGE_PORTS);
 }
 EXPORT_SYMBOL_GPL(qeth_bridgeport_query_ports);
 
@@ -1874,10 +1873,9 @@ int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role)
        cmd->data.sbp.hdr.seq_no = 1;
        rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_set_cb,
                                (void *)&cbctl);
-       if (rc)
+       if (rc < 0)
                return rc;
-       rc = qeth_bridgeport_makerc(card, &cbctl, setcmd);
-       return rc;
+       return qeth_bridgeport_makerc(card, &cbctl, setcmd);
 }
 
 /**