staging: r8188eu: convert rtw_p2p_enable to correct error code semantics
authorPhillip Potter <phil@philpotter.co.uk>
Tue, 2 Aug 2022 23:44:08 +0000 (00:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2022 13:15:23 +0000 (15:15 +0200)
commitbf86e27416d43942a465051c7e2040462bdc734b
tree3b3be52c7a371bcfb0e0c22865f91eedbbbf5b76
parent867d7145374a61b51eb0667c04f9abc2b5942007
staging: r8188eu: convert rtw_p2p_enable to correct error code semantics

Convert the rtw_p2p_enable function to use correct error code semantics
rather than _SUCCESS/_FAIL, and also make sure we allow these to be
passed through properly in the one caller where we actually check the
code, rtw_wext_p2p_enable.

This change moves these functions to a clearer 'return 0;' style at the
end of the function, and in the case of errors now returns ret instead
of jumping to the end of the function, so that these can still be passed
through but without using a goto to jump to a single return statement at
the end which is less clear.

This change moves the driver slowly closer to using standard error code
semantics everywhere.

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/20220802234408.930-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_p2p.c
drivers/staging/r8188eu/os_dep/ioctl_linux.c