From patchwork Wed Feb 13 13:08:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 158213 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp52148jaa; Wed, 13 Feb 2019 05:09:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMw0JBjHqI2lDVyxbIaAbgRBFBEYeKbqDCWJguK4VlXLB3e/FyWbvpyIZvdlv+O7iQwDgb X-Received: by 2002:a63:9751:: with SMTP id d17mr408347pgo.392.1550063371087; Wed, 13 Feb 2019 05:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550063371; cv=none; d=google.com; s=arc-20160816; b=l2591PfSwWl53v9D72Ijnf6E79cr8w/f5OPOTpyzajf2ENXQk710j6wosvEOMaBM6+ JBglWlws14OdumvSQGmcf1zMrnLPJLOcg/c+MOx6yN2bW3JC+a3618hus7X1mlbyM+c+ 3p3Jz6Vpr9sE6exVhKiZMvGIdPVyaS6ifb+L7iGNnFScNgwrQdzIVV/uSrHPtiObCLGN j9KXlFhBU+vR9bYut/NOMrh7KCoF1kV6HrJRRuAChROwReqrcXGFB7T9VVVl+ITidYL/ 1AbZqqAQjiRsfJ0YR9wvUE4AxP3OKtHGCY6pVR4yr6Hr8Rv9UrTsKGfQPmpJEIOHNQyB MvJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=QcFdWQHjdu1mwrSFy/NEtDlZqRSzgcgUFSraxc9UEiM=; b=Jl+wDJIZATwU/geckb78UI01IAgFB1+5ap0m3oxl+moRhwBtvGaj+O8xEMGoHd9VTo m+4pVoWwA2vsi/HJxjec7rO8FenAcadizST/YBZj+zpmCtqCTpC71naKoNYUwTFjODbY X563cBuKYG6k6qFDbxA+Zlgt/XEfLN932wyejtcNTBIxpAxAwj+AdBstyTNUnpgZYXsU unyXqY73N5TMYh8A8KEcQ8yWX5jvhuUj9J3jxu8LgOSXduptgVVDrQAIuPaYZuhr5duh T8aYdOy5WIPKhz7IYpExT07pi4+HfS87fPLvKz8cc/emHUvweVKRTSmNvAAzrJG4NotI JJBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koGfxH8E; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb3si18463476plb.196.2019.02.13.05.09.30; Wed, 13 Feb 2019 05:09:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koGfxH8E; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388979AbfBMNJa (ORCPT + 1 other); Wed, 13 Feb 2019 08:09:30 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36983 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbfBMNJa (ORCPT ); Wed, 13 Feb 2019 08:09:30 -0500 Received: by mail-pg1-f193.google.com with SMTP id q206so1121273pgq.4 for ; Wed, 13 Feb 2019 05:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=QcFdWQHjdu1mwrSFy/NEtDlZqRSzgcgUFSraxc9UEiM=; b=koGfxH8Ex+qosJuEYvhxVsCpO9+z5yuDeASESs2gedOD6YrCOuajZ9TIg3Mr8rfG0z O7zeUO2GGVldsi0pD8zo3EbnPSHk1n2Yw4zcmr7cuOeGMGPC4+R8CkSCya7/tkLbb4hu QCzhFNrCFIXNMzlkisprmzI3l26UeTny7T6SjaaEYOeXuAVOa23ybq3MYEbQweXXwND+ XocyUVtKnXOVgb8cN8Rxyt6lvT/doZTcSX82vrazj4X+DRUsn7JdYkBRCm66zTislSS1 2eLRYR3BMO8AzdMFMs7UyQGQvlya+4HxKDYftaOe7R6gi8y19a40ZeOWFHELYJAe8g5x 5MqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QcFdWQHjdu1mwrSFy/NEtDlZqRSzgcgUFSraxc9UEiM=; b=fbajXJ+V7NA41kEXg19Q8wqW/iFqKAIpIqofqYjyNunAcwT58vMBalnVE4nkxpV68O O+hiAZiB5Nkq+ea1oaUKvuQX4UFceCPEd/+NFkMKQBwFK60NHfqp1V0ddzFMe5T76hes dFjXTSTywTvPb0CMUv1RAYJ1TXwxKAELKRRWKv06RrB/FLcj77HWQs5TZGrxFKcpaPOH /V5hvaVuYgY9f0lv9T4P2ZxGgnlffbJXqgyjajLfJ6eHaauMvdU5tBe9zd6Lcosi8kRU ynbKI0x0wABIYJ/sL6odrVoj9uXwc4UQLjtSh50PyiKlCWQr5WmZwb6zqVXHPJD3ig7R 8WQg== X-Gm-Message-State: AHQUAubJN2BzJU1/XJWdMA9erHiYiqwc+upuft3D5JJfYgXXdqvf1CV4 AfI8TWQ1k4jI7alm3+HobgUSow== X-Received: by 2002:a63:ea15:: with SMTP id c21mr352525pgi.361.1550063369412; Wed, 13 Feb 2019 05:09:29 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id c23sm18740744pgh.73.2019.02.13.05.09.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Feb 2019 05:09:28 -0800 (PST) From: Baolin Wang To: broonie@kernel.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, lanqing.liu@unisoc.com, baolin.wang@linaro.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: sprd: Add a prefix for SPI DMA channel macros Date: Wed, 13 Feb 2019 21:08:16 +0800 Message-Id: <94b245cf862bddcbeba065b6adc3e20f4155bdca.1550063176.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add a prefix for SPI DMA channel macros to avoid namespace conflicts, and no functional changes. Signed-off-by: Baolin Wang --- drivers/spi/spi-sprd.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) -- 1.7.9.5 diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c index 0c04a1d..1b7eebb 100644 --- a/drivers/spi/spi-sprd.c +++ b/drivers/spi/spi-sprd.c @@ -135,14 +135,14 @@ #define SPRD_SPI_DMA_STEP 8 enum sprd_spi_dma_channel { - SPI_RX, - SPI_TX, - SPI_MAX, + SPRD_SPI_RX, + SPRD_SPI_TX, + SPRD_SPI_MAX, }; struct sprd_spi_dma { bool enable; - struct dma_chan *dma_chan[SPI_MAX]; + struct dma_chan *dma_chan[SPRD_SPI_MAX]; enum dma_slave_buswidth width; u32 fragmens_len; u32 rx_len; @@ -516,7 +516,7 @@ static int sprd_spi_dma_submit(struct dma_chan *dma_chan, static int sprd_spi_dma_rx_config(struct sprd_spi *ss, struct spi_transfer *t) { - struct dma_chan *dma_chan = ss->dma.dma_chan[SPI_RX]; + struct dma_chan *dma_chan = ss->dma.dma_chan[SPRD_SPI_RX]; struct dma_slave_config config = { .src_addr = ss->phy_base, .src_addr_width = ss->dma.width, @@ -534,7 +534,7 @@ static int sprd_spi_dma_rx_config(struct sprd_spi *ss, struct spi_transfer *t) static int sprd_spi_dma_tx_config(struct sprd_spi *ss, struct spi_transfer *t) { - struct dma_chan *dma_chan = ss->dma.dma_chan[SPI_TX]; + struct dma_chan *dma_chan = ss->dma.dma_chan[SPRD_SPI_TX]; struct dma_slave_config config = { .dst_addr = ss->phy_base, .src_addr_width = ss->dma.width, @@ -552,23 +552,23 @@ static int sprd_spi_dma_tx_config(struct sprd_spi *ss, struct spi_transfer *t) static int sprd_spi_dma_request(struct sprd_spi *ss) { - ss->dma.dma_chan[SPI_RX] = dma_request_chan(ss->dev, "rx_chn"); - if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPI_RX])) { - if (PTR_ERR(ss->dma.dma_chan[SPI_RX]) == -EPROBE_DEFER) - return PTR_ERR(ss->dma.dma_chan[SPI_RX]); + ss->dma.dma_chan[SPRD_SPI_RX] = dma_request_chan(ss->dev, "rx_chn"); + if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_RX])) { + if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]) == -EPROBE_DEFER) + return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]); dev_err(ss->dev, "request RX DMA channel failed!\n"); - return PTR_ERR(ss->dma.dma_chan[SPI_RX]); + return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]); } - ss->dma.dma_chan[SPI_TX] = dma_request_chan(ss->dev, "tx_chn"); - if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPI_TX])) { - if (PTR_ERR(ss->dma.dma_chan[SPI_TX]) == -EPROBE_DEFER) - return PTR_ERR(ss->dma.dma_chan[SPI_TX]); + ss->dma.dma_chan[SPRD_SPI_TX] = dma_request_chan(ss->dev, "tx_chn"); + if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) { + if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER) + return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]); dev_err(ss->dev, "request TX DMA channel failed!\n"); - dma_release_channel(ss->dma.dma_chan[SPI_RX]); - return PTR_ERR(ss->dma.dma_chan[SPI_TX]); + dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]); + return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]); } return 0; @@ -576,11 +576,11 @@ static int sprd_spi_dma_request(struct sprd_spi *ss) static void sprd_spi_dma_release(struct sprd_spi *ss) { - if (ss->dma.dma_chan[SPI_RX]) - dma_release_channel(ss->dma.dma_chan[SPI_RX]); + if (ss->dma.dma_chan[SPRD_SPI_RX]) + dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]); - if (ss->dma.dma_chan[SPI_TX]) - dma_release_channel(ss->dma.dma_chan[SPI_TX]); + if (ss->dma.dma_chan[SPRD_SPI_TX]) + dma_release_channel(ss->dma.dma_chan[SPRD_SPI_TX]); } static int sprd_spi_dma_txrx_bufs(struct spi_device *sdev,