# Pastebin DNFxIbLa static inline int __xradio_read_reg32(struct xradio_common *hw_priv, u16 addr, u32 *val) { - return __xradio_read(hw_priv, addr, val, sizeof(val), 0); + __le32 *tmp; + int rc; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return -ENOMEM; + + // __xradio_read(hw_priv, addr, val, sizeof(val), 0); + rc = __xradio_read(hw_priv, addr, tmp, sizeof(*tmp), 0); + *val = le32_to_cpu(*tmp); + kfree(tmp); + return rc; } static inline int __xradio_write_reg32(struct xradio_common *hw_priv, u16 addr, u32 val) { - return __xradio_write(hw_priv, addr, &val, sizeof(val), 0); + __le32 *tmp; + int rc; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return -ENOMEM; + + *tmp = cpu_to_le32(val); + // __xradio_write(hw_priv, addr, &val, sizeof(val), 0); + rc = __xradio_write(hw_priv, addr, tmp, sizeof(*tmp), 0); + kfree(tmp); + return rc; }