wifi: mm81x: fix type bugs handling sdio_readl/writel()

The sdio_readl() and sdio_writel() functions, instead of returning kernel
error codes, instead stores the error codes in a parameter.  These caller
functions pass should pass an int pointer to store the error code but
instead pass a signed long.

This will not work on big endian systems.  On little endian systems
passing a ssize_t means negative error codes are converted to positive
values near UINT_MAX.  This doesn't cause a problem at runtime because
in mm81x_sdio_reg32_write() the error codes are discarded and we always
return -EIO.  In mm81x_sdio_reg32_read() the high bits are truncated
away so the positive value is re-converted back to negative and the
code works as intended.

Either way, passing an int is the correct thing and is a cleanup.

Fixes: b1906cea00 ("wifi: mm81x: add mm81x Wi-Fi HaLow driver")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/aoa7Hj1W7ETOrOzO@stanley.mountain
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
This commit is contained in:
Dan Carpenter 2026-08-20 11:30:22 +03:00 • committed by Lachlan Hodges
commit 37f0188099