diff options
author | Sebastian Reichel <sre@kernel.org> | 2023-07-14 03:37:43 +0200 |
---|---|---|
committer | Neil Armstrong <neil.armstrong@linaro.org> | 2023-08-01 10:29:54 +0200 |
commit | fbad26dcb657830e59ba2ca5eaba6be0019b97f9 (patch) | |
tree | 010fed17864ba7be89364c9aeb4d57c3b2669892 | |
parent | drm/panel: sitronix-st7789v: make reset GPIO optional (diff) | |
download | linux-fbad26dcb657830e59ba2ca5eaba6be0019b97f9.tar.xz linux-fbad26dcb657830e59ba2ca5eaba6be0019b97f9.zip |
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
-rw-r--r-- | drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 1d43b8cc1647..6290bd49d055 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -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) |