From patchwork Wed Aug 9 16:57:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9891173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D843601EB for ; Wed, 9 Aug 2017 16:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E57128935 for ; Wed, 9 Aug 2017 16:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 235F2289CD; Wed, 9 Aug 2017 16:57:23 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A798F28935 for ; Wed, 9 Aug 2017 16:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754528AbdHIQ5P (ORCPT ); Wed, 9 Aug 2017 12:57:15 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:47052 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753562AbdHIQ5N (ORCPT ); Wed, 9 Aug 2017 12:57:13 -0400 Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dfUI8-0001L9-0l; Wed, 09 Aug 2017 16:57:10 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dfUI5-0005UP-Ah; Wed, 09 Aug 2017 17:57:05 +0100 From: Mark Brown To: H Hartley Sweeten Cc: Chris Packham , Mark Brown , linux-spi@vger.kernel.org, linux-spi@vger.kernel.org In-Reply-To: <20170216234851.97938-7-hsweeten@visionengravers.com> Message-Id: Date: Wed, 09 Aug 2017 17:57:05 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "spi: spi-ep93xx: remove private data 'current_msg'" to the spi tree X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch spi: spi-ep93xx: remove private data 'current_msg' has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From c7a909cf25c6e1198f5a261d2af0503985871e1a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 9 Aug 2017 08:51:30 +1200 Subject: [PATCH] spi: spi-ep93xx: remove private data 'current_msg' The currently in-flight message can be found from the spi master. Use that instead and remove the private data pointer. Signed-off-by: H Hartley Sweeten Reviewed-by: Andy Shevchenko Signed-off-by: Chris Packham Signed-off-by: Mark Brown --- drivers/spi/spi-ep93xx.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index 2d80e36f5015..cf7d8175bf79 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -74,7 +74,6 @@ * @mmio: pointer to ioremap()'d registers * @sspdr_phys: physical address of the SSPDR register * @wait: wait here until given transfer is completed - * @current_msg: message that is currently processed (or %NULL if none) * @tx: current byte in transfer to transmit * @rx: current byte in transfer to receive * @fifo_level: how full is FIFO (%0..%SPI_FIFO_SIZE - %1). Receiving one @@ -93,7 +92,6 @@ struct ep93xx_spi { void __iomem *mmio; unsigned long sspdr_phys; struct completion wait; - struct spi_message *current_msg; size_t tx; size_t rx; size_t fifo_level; @@ -236,8 +234,7 @@ static void ep93xx_do_read(struct ep93xx_spi *espi, struct spi_transfer *t) static int ep93xx_spi_read_write(struct spi_master *master) { struct ep93xx_spi *espi = spi_master_get_devdata(master); - struct spi_message *msg = espi->current_msg; - struct spi_transfer *t = msg->state; + struct spi_transfer *t = master->cur_msg->state; /* read as long as RX FIFO has frames in it */ while ((readl(espi->mmio + SSPSR) & SSPSR_RNE)) { @@ -290,7 +287,7 @@ ep93xx_spi_dma_prepare(struct spi_master *master, enum dma_transfer_direction dir) { struct ep93xx_spi *espi = spi_master_get_devdata(master); - struct spi_transfer *t = espi->current_msg->state; + struct spi_transfer *t = master->cur_msg->state; struct dma_async_tx_descriptor *txd; enum dma_slave_buswidth buswidth; struct dma_slave_config conf; @@ -415,13 +412,12 @@ static void ep93xx_spi_dma_callback(void *callback_param) static void ep93xx_spi_dma_transfer(struct spi_master *master) { struct ep93xx_spi *espi = spi_master_get_devdata(master); - struct spi_message *msg = espi->current_msg; struct dma_async_tx_descriptor *rxd, *txd; rxd = ep93xx_spi_dma_prepare(master, DMA_DEV_TO_MEM); if (IS_ERR(rxd)) { dev_err(&master->dev, "DMA RX failed: %ld\n", PTR_ERR(rxd)); - msg->status = PTR_ERR(rxd); + master->cur_msg->status = PTR_ERR(rxd); return; } @@ -429,7 +425,7 @@ static void ep93xx_spi_dma_transfer(struct spi_master *master) if (IS_ERR(txd)) { ep93xx_spi_dma_finish(master, DMA_DEV_TO_MEM); dev_err(&master->dev, "DMA TX failed: %ld\n", PTR_ERR(txd)); - msg->status = PTR_ERR(txd); + master->cur_msg->status = PTR_ERR(txd); return; } @@ -587,9 +583,7 @@ static int ep93xx_spi_transfer_one_message(struct spi_master *master, msg->status = 0; msg->actual_length = 0; - espi->current_msg = msg; ep93xx_spi_process_message(master, msg); - espi->current_msg = NULL; spi_finalize_current_message(master); @@ -611,7 +605,7 @@ static irqreturn_t ep93xx_spi_interrupt(int irq, void *dev_id) writel(0, espi->mmio + SSPICR); dev_warn(&master->dev, "receive overrun, aborting the message\n"); - espi->current_msg->status = -EIO; + master->cur_msg->status = -EIO; } else { /* * Interrupt is either RX (RIS) or TX (TIS). For both cases we