]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/qeth: move gdev shutdown handler to core
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Tue, 11 Apr 2017 14:11:12 +0000 (16:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Apr 2017 18:51:34 +0000 (14:51 -0400)
Duplicated code.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 196356e11077c3a310690110553a226269ee5b0f..cc1a4baeba5520ad258e90c18e714b137c859cba 100644 (file)
@@ -711,7 +711,6 @@ struct qeth_discipline {
        void (*remove) (struct ccwgroup_device *);
        int (*set_online) (struct ccwgroup_device *);
        int (*set_offline) (struct ccwgroup_device *);
-       void (*shutdown)(struct ccwgroup_device *);
        int (*prepare) (struct ccwgroup_device *);
        void (*complete) (struct ccwgroup_device *);
        int (*freeze)(struct ccwgroup_device *);
index b9063eb174360bff6222edb11da1116e929aed7d..cf5493e525e8d6a8742380edd5a24649ec1c39ca 100644 (file)
@@ -5749,8 +5749,12 @@ static int qeth_core_set_offline(struct ccwgroup_device *gdev)
 static void qeth_core_shutdown(struct ccwgroup_device *gdev)
 {
        struct qeth_card *card = dev_get_drvdata(&gdev->dev);
-       if (card->discipline && card->discipline->shutdown)
-               card->discipline->shutdown(gdev);
+       qeth_set_allowed_threads(card, 0, 1);
+       if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
+               qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
+       qeth_qdio_clear_card(card, 0);
+       qeth_clear_qdio_buffers(card);
+       qdio_free(CARD_DDEV(card));
 }
 
 static int qeth_core_prepare(struct ccwgroup_device *gdev)
index 572347d65c1dec04a5b247fd20a9c22c04c9a58a..2ad378b57f9fcd82d876689350de1e544fe8be64 100644 (file)
@@ -1200,17 +1200,6 @@ static void __exit qeth_l2_exit(void)
        pr_info("unregister layer 2 discipline\n");
 }
 
-static void qeth_l2_shutdown(struct ccwgroup_device *gdev)
-{
-       struct qeth_card *card = dev_get_drvdata(&gdev->dev);
-       qeth_set_allowed_threads(card, 0, 1);
-       if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
-               qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
-       qeth_qdio_clear_card(card, 0);
-       qeth_clear_qdio_buffers(card);
-       qdio_free(CARD_DDEV(card));
-}
-
 static int qeth_l2_pm_suspend(struct ccwgroup_device *gdev)
 {
        struct qeth_card *card = dev_get_drvdata(&gdev->dev);
@@ -1288,7 +1277,6 @@ struct qeth_discipline qeth_l2_discipline = {
        .remove = qeth_l2_remove_device,
        .set_online = qeth_l2_set_online,
        .set_offline = qeth_l2_set_offline,
-       .shutdown = qeth_l2_shutdown,
        .freeze = qeth_l2_pm_suspend,
        .thaw = qeth_l2_pm_resume,
        .restore = qeth_l2_pm_resume,
index bd6ad9be92458df04d2dd485a7e32cdecf098034..ca21a2065a5de20b63c24e0dd72357c3b41ebceb 100644 (file)
@@ -3251,17 +3251,6 @@ static int qeth_l3_recover(void *ptr)
        return 0;
 }
 
-static void qeth_l3_shutdown(struct ccwgroup_device *gdev)
-{
-       struct qeth_card *card = dev_get_drvdata(&gdev->dev);
-       qeth_set_allowed_threads(card, 0, 1);
-       if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
-               qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
-       qeth_qdio_clear_card(card, 0);
-       qeth_clear_qdio_buffers(card);
-       qdio_free(CARD_DDEV(card));
-}
-
 static int qeth_l3_pm_suspend(struct ccwgroup_device *gdev)
 {
        struct qeth_card *card = dev_get_drvdata(&gdev->dev);
@@ -3325,7 +3314,6 @@ struct qeth_discipline qeth_l3_discipline = {
        .remove = qeth_l3_remove_device,
        .set_online = qeth_l3_set_online,
        .set_offline = qeth_l3_set_offline,
-       .shutdown = qeth_l3_shutdown,
        .freeze = qeth_l3_pm_suspend,
        .thaw = qeth_l3_pm_resume,
        .restore = qeth_l3_pm_resume,