]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drivers/net/ftgmac100: refactor ftgmac100_reset_task to enable direct function call
authorHeyi Guo <guoheyi@linux.alibaba.com>
Wed, 23 Feb 2022 03:14:34 +0000 (11:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Feb 2022 12:50:19 +0000 (12:50 +0000)
This is to prepare for ftgmac100_adjust_link() to call reset function
directly, instead of task schedule.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c

index 691605c152659b8c182df87a9ffab5aaaba99dff..1f3eb44314753f2d0be9fdd8246649dc6550559d 100644 (file)
@@ -1410,10 +1410,8 @@ static int ftgmac100_init_all(struct ftgmac100 *priv, bool ignore_alloc_err)
        return err;
 }
 
-static void ftgmac100_reset_task(struct work_struct *work)
+static void ftgmac100_reset(struct ftgmac100 *priv)
 {
-       struct ftgmac100 *priv = container_of(work, struct ftgmac100,
-                                             reset_task);
        struct net_device *netdev = priv->netdev;
        int err;
 
@@ -1459,6 +1457,14 @@ static void ftgmac100_reset_task(struct work_struct *work)
        rtnl_unlock();
 }
 
+static void ftgmac100_reset_task(struct work_struct *work)
+{
+       struct ftgmac100 *priv = container_of(work, struct ftgmac100,
+                                             reset_task);
+
+       ftgmac100_reset(priv);
+}
+
 static int ftgmac100_open(struct net_device *netdev)
 {
        struct ftgmac100 *priv = netdev_priv(netdev);