From: Thomas Zimmermann Date: Tue, 21 Feb 2023 15:57:42 +0000 (+0100) Subject: drm/ast: Remove little-endianism from I/O helpers X-Git-Tag: v6.4-rc1~162^2~25^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a38410860628909712ea6a2becd42bab56c70e9a;p=thirdparty%2Fkernel%2Flinux.git drm/ast: Remove little-endianism from I/O helpers Replace one call to ast_io_write16() with two calls to ast_io_write8() in ast_set_index_reg(). The combined 16-bit-wide write of an index register and the corresponding data register only works on little- endian systems. Write both registers independent from each other. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230221155745.27484-2-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index d51b81fea9c80..1f46162adb649 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -282,7 +282,9 @@ static inline void ast_set_index_reg(struct ast_private *ast, uint32_t base, uint8_t index, uint8_t val) { - ast_io_write16(ast, base, ((u16)val << 8) | index); + ast_io_write8(ast, base, index); + ++base; + ast_io_write8(ast, base, val); } void ast_set_index_reg_mask(struct ast_private *ast,