diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2021-01-28 12:25:47 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-28 20:35:57 -0800 |
commit | ea12f1b3c8289102620d3030de3547eedce6d9e8 (patch) | |
tree | b1240f4da6652535ac5906edfecdfba23ffd1f65 /drivers/s390/net/qeth_core_sys.c | |
parent | 699e4bc8c363f06c8f2e138aeec15d6105edd1a5 (diff) | |
download | linux-ea12f1b3c8289102620d3030de3547eedce6d9e8.tar.gz linux-ea12f1b3c8289102620d3030de3547eedce6d9e8.tar.bz2 linux-ea12f1b3c8289102620d3030de3547eedce6d9e8.zip |
s390/qeth: clean up load/remove code for disciplines
We have two usage patterns:
1. get & ->setup() a new discipline, or
2. ->remove() & put the currently loaded one.
Add corresponding helpers that hide the internals & error handling.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/s390/net/qeth_core_sys.c')
-rw-r--r-- | drivers/s390/net/qeth_core_sys.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index a0f777f76f66..5815114da468 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -384,19 +384,13 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, goto out; } - card->discipline->remove(card->gdev); - qeth_core_free_discipline(card); + qeth_remove_discipline(card); free_netdev(card->dev); card->dev = ndev; } - rc = qeth_core_load_discipline(card, newdis); - if (rc) - goto out; + rc = qeth_setup_discipline(card, newdis); - rc = card->discipline->setup(card->gdev); - if (rc) - qeth_core_free_discipline(card); out: mutex_unlock(&card->discipline_mutex); return rc ? rc : count; |