From patchwork Sat Apr 22 20:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 676221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EA1CC77B7D for ; Sat, 22 Apr 2023 20:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbjDVUuf (ORCPT ); Sat, 22 Apr 2023 16:50:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbjDVUuc (ORCPT ); Sat, 22 Apr 2023 16:50:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556292697; Sat, 22 Apr 2023 13:50:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DCA466141C; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22B98C433D2; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=qucudSlPchI3svnOIhdFV9BiouDXG/kOilDZtzG2V8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AdtXJEch7BT8FPzNbIzVkdDmmBN2p3kL10NBU5moWj61DTwmx15WvtMOgLtFRT4Nc j0NuC+dNOZghYWBXTiRsfswdEwu0zp8Q2YkSOVlLuspQsRBQ8KKWMV1sNGbIjESE0+ shqLCVXQfdjzEH/fZgLTNBa3ehTuZ/F0WEr2MVBkpyCE+8xxl1gM4PerEry/t4qg2F k7MzN7tQw+uf+0qt9q9RdI3zZUkPy0l2k4smddLZe8UquDZWV5NopOLJdn3bKFPSzi JHQPQeXcgWQQm510KcncwLOFQ7A6x1ZubWPp5nVkNkb2mlz2XHJZ4pdH5dvwJJkVWl GHz6/Og4WB9uA== Received: by mercury (Postfix, from userid 1000) id 14A471066CC6; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Cc: Gerald Loacker , Michael Riesch , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 06/13] drm/panel: sitronix-st7789v: simplify st7789v_spi_write Date: Sat, 22 Apr 2023 22:50:05 +0200 Message-Id: <20230422205012.2464933-7-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org st7789v_spi_write initializes a message with just a single transfer, spi_sync_transfer can be used for that. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 +----- 1 file changed, 1 insertion(+), 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)