mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
drm/panel: sitronix-st7789v: simplify st7789v_spi_write
st7789v_spi_write initializes a message with just a single transfer, spi_sync_transfer can be used for that. Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230714013756.1546769-7-sre@kernel.org
This commit is contained in:
parent
b6b65e45e0
commit
fbad26dcb6
1 changed files with 1 additions and 5 deletions
|
@ -129,17 +129,13 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix,
|
|||
u8 data)
|
||||
{
|
||||
struct spi_transfer xfer = { };
|
||||
struct spi_message msg;
|
||||
u16 txbuf = ((prefix & 1) << 8) | data;
|
||||
|
||||
spi_message_init(&msg);
|
||||
|
||||
xfer.tx_buf = &txbuf;
|
||||
xfer.bits_per_word = 9;
|
||||
xfer.len = sizeof(txbuf);
|
||||
|
||||
spi_message_add_tail(&xfer, &msg);
|
||||
return spi_sync(ctx->spi, &msg);
|
||||
return spi_sync_transfer(ctx->spi, &xfer, 1);
|
||||
}
|
||||
|
||||
static int st7789v_write_command(struct st7789v *ctx, u8 cmd)
|
||||
|
|
Loading…
Reference in a new issue