From patchwork Sat Jul 20 13:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 11050901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBFAD14F6 for ; Sat, 20 Jul 2019 13:47:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A327128876 for ; Sat, 20 Jul 2019 13:47:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9636B288CB; Sat, 20 Jul 2019 13:47:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD1A328876 for ; Sat, 20 Jul 2019 13:47:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 332456E8B1; Sat, 20 Jul 2019 13:47:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id A37226E8B1 for ; Sat, 20 Jul 2019 13:47:18 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:56672 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hophk-0003FR-Le; Sat, 20 Jul 2019 15:47:16 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] drm/tinydrm/mipi-dbi: Move cmdlock mutex init Date: Sat, 20 Jul 2019 15:47:04 +0200 Message-Id: <20190720134709.15186-2-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190720134709.15186-1-noralf@tronnes.org> References: <20190720134709.15186-1-noralf@tronnes.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=mEieYDuZ96/juE0UpBoQFnb4m6OVYIewkuOeuRaV/MU=; b=YKoOCfachJmT0OiXLCH3MOXEryAlf6FmsYqK3b7f3zCJTQZXMVKvaZ2ANxdnaXTRx1Ndbeh1uauFDl5+OYOIZTGNuD5xQB5+131i8mXRqjj2GlfVHsOacQNemuXjYXbAko69xl47EzPSaew9PVNrEzjxDvfaIEYyG8mcb2fmMNd2T/PiGJhTz4Y0vd0pYDEaf0qWl/0qUF+IAR07UJsrBG8J5HwjUQERNf+gceS/JU7MSMJjlrVQQzCSIVG3heabzNVx4ZEXwT+EnRuNnMFM3A2VNCPFdtNQ0w2swljvcI+Ev0yYjFbD743Wn0lHpHZf5pJaMUhPB/wypHnGQ5mj7Q==; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david@lechnology.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP cmdlock protects command execution so put it in mipi_dbi_spi_init() where it conceptually belongs. This is prep work for the splitting of struct mipi_dbi. Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 42465228129c..37a73b4c0f85 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -506,8 +506,6 @@ int mipi_dbi_init_with_formats(struct mipi_dbi *mipi, if (!mipi->command) return -EINVAL; - mutex_init(&mipi->cmdlock); - mipi->tx_buf = devm_kmalloc(drm->dev, tx_buf_size, GFP_KERNEL); if (!mipi->tx_buf) return -ENOMEM; @@ -1120,6 +1118,8 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, return -ENOMEM; } + mutex_init(&mipi->cmdlock); + DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); return 0;