From patchwork Mon Jul 22 10:43: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: 11052123 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 0EB52112C for ; Mon, 22 Jul 2019 10:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F057428500 for ; Mon, 22 Jul 2019 10:43:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E43CA2851B; Mon, 22 Jul 2019 10:43:29 +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 5433A28500 for ; Mon, 22 Jul 2019 10:43:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0FA78979F; Mon, 22 Jul 2019 10:43:26 +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 918EA89A61 for ; Mon, 22 Jul 2019 10:43:25 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:55388 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 1hpVmt-0001lD-Nd; Mon, 22 Jul 2019 12:43:23 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/9] drm/tinydrm/mipi-dbi: Move cmdlock mutex init Date: Mon, 22 Jul 2019 12:43:04 +0200 Message-Id: <20190722104312.16184-2-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722104312.16184-1-noralf@tronnes.org> References: <20190722104312.16184-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=1UIi3LFAJ0z87Iki0W3LMC7oy/x16zToVygXpno5g/w=; b=LpJQRr88BCCm1AghEbtecK9Ru/SwlLKk9fyljJ8rKApsrSyMu5dND6OHOAyKumZjWP1J0YQ1Bg0YIK4iX/YL+zaDAY1SKk8JmbcX9qsNyRFVU0vfZtkDIPqs7/vzdZFmozXKkEuEmVE4Dg8EMFozxVo0oHyRU3OEJlTlLj/6kR9KzWqEp6pfqElXeuMinig0/J6x9hKnkaAUfZgTqDlIwnkQkBy0UsYgS7u97l81tv69Ssdr3H3oqRwCpFkDCCPcLhKydX2fAgJ576WLfSzsL76xosXAbDvCPFjT9n/hb/9c+GZHW3qhji+/ysClP9aV8sQNHRDyGmzH0AFhRznayQ==; 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: sam@ravnborg.org, 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. Reviewed-by: Sam Ravnborg 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;