staging: r8188eu: convert rtw_pwr_wakeup to correct error code semantics
authorPhillip Potter <phil@philpotter.co.uk>
Mon, 25 Jul 2022 22:07:45 +0000 (23:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2022 06:45:32 +0000 (08:45 +0200)
commit2b5002e2cc1483b6333d31e21902b78a1997909e
treece6a08152a314d315d610c36858acb9c59dba942
parent47092381023050ab90c3f0603a587f798d37f194
staging: r8188eu: convert rtw_pwr_wakeup to correct error code semantics

Convert the rtw_pwr_wakeup function to use 0 on success and an appropriate
error code on error. For the first failure block where ips_leave is
invoked, use -ENOMEM as this is the main cause of failure here anyway.
For the second failure block, use -EBUSY, as it seems the most
appropriate.

Finally, within the functions rtw_wx_set_mode, rtw_wx_set_wap,
rtw_wx_set_scan and rtw_wx_set_essid, pass the error code on from
rtw_pwr_wakeup as appropriate now that it is converted.

This gets the driver closer to removal of the non-standard _SUCCESS and
_FAIL definitions, which are inverted compared to the standard in-kernel
error code mechanism.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220725220745.12739-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_p2p.c
drivers/staging/r8188eu/core/rtw_pwrctrl.c
drivers/staging/r8188eu/os_dep/ioctl_linux.c