From patchwork Thu Nov 25 12:41:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12693648 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F9A3C433F5 for ; Thu, 25 Nov 2021 12:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GyL5A0fu5sbfEXldIxouZJCbobS8cf6WGYeY0fzzyUE=; b=B8ZNEOY1Z4s4U5 8FVBVU04nL9l/ptzgIlHNA871rI8IRJI7UlcvsaQVmv81ctosJUuiaBi5jmEqwYvEpJdJZt6NRcF5 CnhwjMfp+f0YkH5kRnImGoPEfDh4BUaqoXcuIGbDRxqPVTbrlVjDrTqcBZdvhX+SOUz2u07T54g/R QxUGI5lt0eJ5LSoQxyW2SPcUt/7bWSzpiu7LP54ZukK8UqbvHhzNnmgDhdKSIVwCzHM7c1TE12oZD YFsUqaZjive260h+mx4J8dH0xLLxz5joxOOWcYL9pZyOeuxoaX03GqFedBo9G0DkfucR5FCO9nAVZ SRoIJ9mDKcfgugblCWHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqE4J-007R5I-AR; Thu, 25 Nov 2021 12:41:39 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqE41-007R0g-Pv for linux-arm-kernel@lists.infradead.org; Thu, 25 Nov 2021 12:41:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1637844083; x=1669380083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Twni1p76FodKjv3xPWrmvD2cFE0XBN5XBjkX4FZSD1U=; b=jE7KG+5BF3P484I3mu/P88kgSaXkepu9q903zMke8VmdzlxI10ApC07F 1RtZftuB+xoed78nZ+u3ZLF99DDhH6BQKTxXQ2qnk7p/xhiAqJXqabWRh SnrK7rz/InLNY/uClsdUFbzVJGD89lPSEvRvg6G/3h3j6XJ/F3vZpaZoG V3egs+OCktqEs7n5A0bOKR1H8VHHXfmkbaJgehH06EjLMYe59dh44kKPY jGiRAJ40YwrgrHIRIPlXrEjAqobK7uB+qEzhpaFJ8yufbKYT9Y71jKsI5 bnUSwGwu45nLOz9JQCSLRcKShxzB3Hx+rk+fsRMcuqtvTp5Few8eLER3h Q==; IronPort-SDR: kPC96V2z2oiETc3pap99SL43DJNlfOPFpfks2mZw/cOXVpeASiS466SPTT9cZMaBTyDFfu9+aK pAD7vIOxc6boCdRc1xkUml+NV9p2fUC6ewL57cRY/0+bsJw7Cdca1PKLrXb/zvuStVQS5tgILY ZFa1QUM45RDRcVjR5U8Vzf7hAaAlVHXy5q0s+TgTlWe6othSPxBw4lpEAv+qStvJ6iGse5u32U J9GfhGypj+/AOl36hJBLaPgahILPqZpJjQyBFaiYdbTL074QvMmGDP6eAEF32ulmDnoUS1we4k aAJxRD+oLMBLyOcWo8XOHcXV X-IronPort-AV: E=Sophos;i="5.87,263,1631602800"; d="scan'208";a="144550448" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2021 05:41:22 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 25 Nov 2021 05:41:21 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 25 Nov 2021 05:41:19 -0700 From: Tudor Ambarus To: Subject: [PATCH 1/2] spi: atmel: Drop slave_config argument in atmel_spi_dma_slave_config() Date: Thu, 25 Nov 2021 14:41:09 +0200 Message-ID: <20211125124110.838037-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211125124110.838037-1-tudor.ambarus@microchip.com> References: <20211125124110.838037-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_044121_876145_99499E5E X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The callers passed a pointer to slave_config as an argument of atmel_spi_dma_slave_config(), but they did not use it afterwards. Use instead a local variable in atmel_spi_dma_slave_config(), and stop passing arguments that are not needed in the callers. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-atmel.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index f872cf196c2f..22c7239aff75 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -433,26 +433,25 @@ static bool atmel_spi_can_dma(struct spi_master *master, } -static int atmel_spi_dma_slave_config(struct atmel_spi *as, - struct dma_slave_config *slave_config, - u8 bits_per_word) +static int atmel_spi_dma_slave_config(struct atmel_spi *as, u8 bits_per_word) { struct spi_master *master = platform_get_drvdata(as->pdev); + struct dma_slave_config slave_config; int err = 0; if (bits_per_word > 8) { - slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; } else { - slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; - slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; + slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; + slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; } - slave_config->dst_addr = (dma_addr_t)as->phybase + SPI_TDR; - slave_config->src_addr = (dma_addr_t)as->phybase + SPI_RDR; - slave_config->src_maxburst = 1; - slave_config->dst_maxburst = 1; - slave_config->device_fc = false; + slave_config.dst_addr = (dma_addr_t)as->phybase + SPI_TDR; + slave_config.src_addr = (dma_addr_t)as->phybase + SPI_RDR; + slave_config.src_maxburst = 1; + slave_config.dst_maxburst = 1; + slave_config.device_fc = false; /* * This driver uses fixed peripheral select mode (PS bit set to '0' in @@ -468,8 +467,8 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as, * So we'd rather write only one data at the time. Hence the transmit * path works the same whether FIFOs are available (and enabled) or not. */ - slave_config->direction = DMA_MEM_TO_DEV; - if (dmaengine_slave_config(master->dma_tx, slave_config)) { + slave_config.direction = DMA_MEM_TO_DEV; + if (dmaengine_slave_config(master->dma_tx, &slave_config)) { dev_err(&as->pdev->dev, "failed to configure tx dma channel\n"); err = -EINVAL; @@ -483,8 +482,8 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as, * So the receive path works the same whether FIFOs are available (and * enabled) or not. */ - slave_config->direction = DMA_DEV_TO_MEM; - if (dmaengine_slave_config(master->dma_rx, slave_config)) { + slave_config.direction = DMA_DEV_TO_MEM; + if (dmaengine_slave_config(master->dma_rx, &slave_config)) { dev_err(&as->pdev->dev, "failed to configure rx dma channel\n"); err = -EINVAL; @@ -496,7 +495,6 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as, static int atmel_spi_configure_dma(struct spi_master *master, struct atmel_spi *as) { - struct dma_slave_config slave_config; struct device *dev = &as->pdev->dev; int err; @@ -518,7 +516,7 @@ static int atmel_spi_configure_dma(struct spi_master *master, goto error; } - err = atmel_spi_dma_slave_config(as, &slave_config, 8); + err = atmel_spi_dma_slave_config(as, 8); if (err) goto error; @@ -700,7 +698,6 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, struct dma_chan *txchan = master->dma_tx; struct dma_async_tx_descriptor *rxdesc; struct dma_async_tx_descriptor *txdesc; - struct dma_slave_config slave_config; dma_cookie_t cookie; dev_vdbg(master->dev.parent, "atmel_spi_next_xfer_dma_submit\n"); @@ -712,8 +709,7 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, *plen = xfer->len; - if (atmel_spi_dma_slave_config(as, &slave_config, - xfer->bits_per_word)) + if (atmel_spi_dma_slave_config(as, xfer->bits_per_word)) goto err_exit; /* Send both scatterlists */ From patchwork Thu Nov 25 12:41:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12693647 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05A65C433EF for ; Thu, 25 Nov 2021 12:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NLr2j4/nzD24F3ynA6AIK6r+nu/Za/y+K+XuMUdIniI=; b=0jRfpNkonyPp0G viz/H2GS7f74rhVBaMloEFPGwpEgNhTUz3BX0xJPw4JnbVhB5nr6LUGXPN6pLWM0aKtYZsfvUPlMS Ox+kCEC8EAQWS6lIvwJF1dZkLl+kVg8474nMlFFnEyJBDzlWUHiDt2E1M52nChwCov07hiIDuTVnW bH55ib8euwSM245/pUeYvCXnv8a8zoczcsO2/J92c6xUcUgUYNjzhCTh1SYfo8Anurw/u/zAalO9x IMDdukI+KARSe2xpcSIVFrJk7vLTlWpQ35id6oIZtzRb02aiLdWFE4aDd51X/JXGZiOfF39H+ghzG M583fEu08L+iktaTZW7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqE4b-007RB7-5i; Thu, 25 Nov 2021 12:41:57 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqE46-007R2K-B1 for linux-arm-kernel@lists.infradead.org; Thu, 25 Nov 2021 12:41:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1637844086; x=1669380086; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UvL20kSfQpiwu4gQDL55HWjDeylOBEFGs1CcUR3JMng=; b=pbgS875lRbwavIlxpATQyt67WlmC5Rwd7GQAe78ZI/pl6mGvGoa61VZk U7nA6nKxMp37eHqfdfZNAH/dUbi2F28vCTo2bRX8zvOwbGJYSnwjq5jbx 0MHIRSGqeXd2ydmtqpguhCJrJIBHamj47X1ahrnuy23ZvetuBwfGoW5sW 6E85e7VuHYjeB6bjz39FkfDJGVeLQI8lYvHN7fK2XF+PbDZhavSKeNDgO hj7zG+QF2kXnPqXY37gLvZXV9j7XrS8qsLN4KNya1Zf8w+wSiseHDlp+I A3BsuCnsKhzKkewZ1oIvORK+aSTv3GUPUfqPWBHzmlqmR4fYlEKhILb5x A==; IronPort-SDR: q2Sj2Dk60CG8n94GXGT9nk3SIrM9ywyKf/5l9xhKbIDiQK3lBCPitTM/z5c+GKArDbWf99Cxxn C3/L/eD5RtfbT4WBqIaaIDi92yOlOqiVdu4Y36Ir8AdCW1h+iUxNIDoeIDDrRief7WTI2BYX9s cWC5Mc0TKHuiWXJjhU617rJp47ZalJDt+sEWGlvrwftOJxg0hDRJrn6YRyssK9CPPiTqbyVFTS qeyUt19mK6cm/kG1yHiOEfb8MSuqvl7e16+ffUgKoSlMSidJZLG+riAyMiVWwKnqdtgcsQOydm /R/SR55+MBPXsuiAQTtWOJXc X-IronPort-AV: E=Sophos;i="5.87,263,1631602800"; d="scan'208";a="140297319" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2021 05:41:24 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 25 Nov 2021 05:41:23 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 25 Nov 2021 05:41:21 -0700 From: Tudor Ambarus To: Subject: [PATCH 2/2] spi: atmel: Remove setting of deprecated member of struct dma_slave_config Date: Thu, 25 Nov 2021 14:41:10 +0200 Message-ID: <20211125124110.838037-3-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211125124110.838037-1-tudor.ambarus@microchip.com> References: <20211125124110.838037-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_044126_490187_4A873F24 X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 'direction' member of 'struct dma_slave_config' is deprecated. Instead, drivers should use the direction argument to the device_prep_slave_sg and device_prep_dma_cyclic functions or the dir field in the dma_interleaved_template structure. spi-atmel uses the direction argument to dmaengine_prep_slave_sg. slave_config.direction is not used in neither of the DMA controller drivers (at_h/xdmac) that spi-atmel is using, we can just remove the setting of slave_config.direction and live with whatever stack value is there. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-atmel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 22c7239aff75..f6626be4d4f7 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -467,7 +467,6 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as, u8 bits_per_word) * So we'd rather write only one data at the time. Hence the transmit * path works the same whether FIFOs are available (and enabled) or not. */ - slave_config.direction = DMA_MEM_TO_DEV; if (dmaengine_slave_config(master->dma_tx, &slave_config)) { dev_err(&as->pdev->dev, "failed to configure tx dma channel\n"); @@ -482,7 +481,6 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as, u8 bits_per_word) * So the receive path works the same whether FIFOs are available (and * enabled) or not. */ - slave_config.direction = DMA_DEV_TO_MEM; if (dmaengine_slave_config(master->dma_rx, &slave_config)) { dev_err(&as->pdev->dev, "failed to configure rx dma channel\n");