Skip to content

Commit 1241c56

Browse files
Marek VasutKalle Valo
authored andcommitted
wifi: wilc1000: Fill in missing error handling
Add error handling to chip_wakeup() and propagate the errors throughout the entire driver. Add error handling to acquire_bus()/release_bus() and host_sleep_notify()/host_wakeup_notify() functions as a result as well. Fill the error handling to all call sites. Reviewed-by: Alexis Lothoré <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0a6ea2e commit 1241c56

File tree

3 files changed

+118
-51
lines changed

3 files changed

+118
-51
lines changed

drivers/net/wireless/microchip/wilc1000/sdio.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ static int wilc_sdio_suspend(struct device *dev)
960960
{
961961
struct sdio_func *func = dev_to_sdio_func(dev);
962962
struct wilc *wilc = sdio_get_drvdata(func);
963+
int ret;
963964

964965
dev_info(dev, "sdio suspend\n");
965966

@@ -969,7 +970,11 @@ static int wilc_sdio_suspend(struct device *dev)
969970
if (!IS_ERR(wilc->rtc_clk))
970971
clk_disable_unprepare(wilc->rtc_clk);
971972

972-
host_sleep_notify(wilc);
973+
ret = host_sleep_notify(wilc);
974+
if (ret) {
975+
clk_prepare_enable(wilc->rtc_clk);
976+
return ret;
977+
}
973978

974979
wilc_sdio_disable_interrupt(wilc);
975980

@@ -992,9 +997,7 @@ static int wilc_sdio_resume(struct device *dev)
992997
wilc_sdio_init(wilc, true);
993998
wilc_sdio_enable_interrupt(wilc);
994999

995-
host_wakeup_notify(wilc);
996-
997-
return 0;
1000+
return host_wakeup_notify(wilc);
9981001
}
9991002

10001003
static const struct of_device_id wilc_of_match[] = {

0 commit comments

Comments
 (0)