wifi: wilc1000: move sdio suspend method next to resume and pm ops definition
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Thu, 13 Jun 2024 14:06:43 +0000 (16:06 +0200)
committerKalle Valo <kvalo@kernel.org>
Tue, 18 Jun 2024 10:23:16 +0000 (13:23 +0300)
Just move the suspend method next to the resume method in the sdio part

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240613-wilc_suspend-v1-4-c2f766d0988c@bootlin.com
drivers/net/wireless/microchip/wilc1000/sdio.c

index fb4de3de1140d8857f514ede73e060940b50947d..21398a3c600b8e7306dacbf157284d1d77e44480 100644 (file)
@@ -249,30 +249,6 @@ static bool wilc_sdio_is_init(struct wilc *wilc)
        return sdio_priv->isinit;
 }
 
-static int wilc_sdio_suspend(struct device *dev)
-{
-       struct sdio_func *func = dev_to_sdio_func(dev);
-       struct wilc *wilc = sdio_get_drvdata(func);
-       int ret;
-
-       dev_info(dev, "sdio suspend\n");
-
-       if (!IS_ERR(wilc->rtc_clk))
-               clk_disable_unprepare(wilc->rtc_clk);
-
-       if (wilc->suspend_event) {
-               host_sleep_notify(wilc);
-       }
-
-       ret = wilc_sdio_reset(wilc);
-       if (ret) {
-               dev_err(&func->dev, "Fail reset sdio\n");
-               return ret;
-       }
-
-       return 0;
-}
-
 static int wilc_sdio_enable_interrupt(struct wilc *dev)
 {
        struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
@@ -993,6 +969,29 @@ static const struct wilc_hif_func wilc_hif_sdio = {
        .hif_is_init = wilc_sdio_is_init,
 };
 
+static int wilc_sdio_suspend(struct device *dev)
+{
+       struct sdio_func *func = dev_to_sdio_func(dev);
+       struct wilc *wilc = sdio_get_drvdata(func);
+       int ret;
+
+       dev_info(dev, "sdio suspend\n");
+
+       if (!IS_ERR(wilc->rtc_clk))
+               clk_disable_unprepare(wilc->rtc_clk);
+
+       if (wilc->suspend_event)
+               host_sleep_notify(wilc);
+
+       ret = wilc_sdio_reset(wilc);
+       if (ret) {
+               dev_err(&func->dev, "Fail reset sdio\n");
+               return ret;
+       }
+
+       return 0;
+}
+
 static int wilc_sdio_resume(struct device *dev)
 {
        struct sdio_func *func = dev_to_sdio_func(dev);