Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp717496ybc; Fri, 22 Nov 2019 12:00:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzZxzPPufXg3Hi9DNQwv/jmvwsF3XApX4ZEsI4GSyjnhSZeuoXQqKamk9Xw07bQqvZVObFX X-Received: by 2002:a17:906:1805:: with SMTP id v5mr24836750eje.45.1574452799914; Fri, 22 Nov 2019 11:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574452799; cv=none; d=google.com; s=arc-20160816; b=lKh9QdJ9JlQ6htOYBEu8GkEfOIWklTuQMrg6C3CBmduFrpyXzfBg6C/ke4BOZRfKbc wEGpH2V4YE8GPTTZxuihHFUXGVp17OFX1Hp1gnDUie2l40xqSXjp75NYjIzkNTxRNZbp rWr6g95lWthS1iJEoiUAiMaxSVCjKiwA6YFRs51iT5Vyn2heplMvrCgppy6YudzjtxKD NQXF898/0WEqe+AgvWcM3OD+pxOORfi7FwT1mtUehpHE4PFHuUrRocvKXWfDUagQp/4C TNd+esaOQQVSim7YZPuN71k0U1G5+1bR77dnU7bueP3zz/wOUBXllOE9T6tImZrHbNoU 7m0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=EDG0jFkm7jgghXqVrK/FEY945od41DYsqVaUTUerPfo=; b=sXs56YHxxfIVp2tYfcPISl53PcMwBQNEqOSKTPdRcLeZz0XPfXTaxfsgRqWR1bu+AK N9qS8yiTAz2jnwp8yYEFt02UK9vO58hwx71G5dZ/pnnjn7KG4H4cXvdvA/9edMiVH22B ZJ6wY1082ggKug9afk1gLgFqOwY7CH0Ib4035hfOh/fDne9Q/82bllNcZ/Hur7CJI6mu rmMyE/c7jR6BOIP3jN+YgLSzdtLB3KThkhewqOp3U0Zx7d2avnuotIpLqlFi3l7QsE+l ntiOKLbplFvP4hmrSzKR0g0pKJ8PV+PuzDLGOMIQQtBFsz4v4jdNTaExqraIalgqtmXi /q1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si5115062ejf.418.2019.11.22.11.59.35; Fri, 22 Nov 2019 11:59:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbfKVTzs (ORCPT + 99 others); Fri, 22 Nov 2019 14:55:48 -0500 Received: from foss.arm.com ([217.140.110.172]:52186 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfKVTzq (ORCPT ); Fri, 22 Nov 2019 14:55:46 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 172C61396; Fri, 22 Nov 2019 11:55:46 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 885AF3F6C4; Fri, 22 Nov 2019 11:55:45 -0800 (PST) Date: Fri, 22 Nov 2019 19:55:44 +0000 From: Mark Brown To: Peter Ujfalusi Cc: broonie@kernel.org, geert@linux-m68k.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown , vkoul@kernel.org Subject: Applied "spi: pic32: Retire dma_request_slave_channel_compat()" to the spi tree In-Reply-To: <20191121092703.30465-1-peter.ujfalusi@ti.com> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: pic32: Retire dma_request_slave_channel_compat() has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.5 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 eb7e6dc6d9ffcce129ac04d4e7bd2dc015bd45a5 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 21 Nov 2019 11:27:03 +0200 Subject: [PATCH] spi: pic32: Retire dma_request_slave_channel_compat() There is no reason to use the dma_request_slave_channel_compat() as no filter function and parameter is provided. Switch the driver to use dma_request_chan() instead and add support for deferred probing against DMA channel. Signed-off-by: Peter Ujfalusi Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20191121092703.30465-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown --- drivers/spi/spi-pic32.c | 46 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c index 69f517ec59c6..156961b4ca86 100644 --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -606,25 +606,30 @@ static void pic32_spi_cleanup(struct spi_device *spi) gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); } -static void pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev) +static int pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev) { struct spi_master *master = pic32s->master; - dma_cap_mask_t mask; + int ret = 0; - dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); + master->dma_rx = dma_request_chan(dev, "spi-rx"); + if (IS_ERR(master->dma_rx)) { + if (PTR_ERR(master->dma_rx) == -EPROBE_DEFER) + ret = -EPROBE_DEFER; + else + dev_warn(dev, "RX channel not found.\n"); - master->dma_rx = dma_request_slave_channel_compat(mask, NULL, NULL, - dev, "spi-rx"); - if (!master->dma_rx) { - dev_warn(dev, "RX channel not found.\n"); + master->dma_rx = NULL; goto out_err; } - master->dma_tx = dma_request_slave_channel_compat(mask, NULL, NULL, - dev, "spi-tx"); - if (!master->dma_tx) { - dev_warn(dev, "TX channel not found.\n"); + master->dma_tx = dma_request_chan(dev, "spi-tx"); + if (IS_ERR(master->dma_tx)) { + if (PTR_ERR(master->dma_tx) == -EPROBE_DEFER) + ret = -EPROBE_DEFER; + else + dev_warn(dev, "TX channel not found.\n"); + + master->dma_tx = NULL; goto out_err; } @@ -634,14 +639,20 @@ static void pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev) /* DMA chnls allocated and prepared */ set_bit(PIC32F_DMA_PREP, &pic32s->flags); - return; + return 0; out_err: - if (master->dma_rx) + if (master->dma_rx) { dma_release_channel(master->dma_rx); + master->dma_rx = NULL; + } - if (master->dma_tx) + if (master->dma_tx) { dma_release_channel(master->dma_tx); + master->dma_tx = NULL; + } + + return ret; } static void pic32_spi_dma_unprep(struct pic32_spi *pic32s) @@ -776,7 +787,10 @@ static int pic32_spi_probe(struct platform_device *pdev) master->unprepare_transfer_hardware = pic32_spi_unprepare_hardware; /* optional DMA support */ - pic32_spi_dma_prep(pic32s, &pdev->dev); + ret = pic32_spi_dma_prep(pic32s, &pdev->dev); + if (ret) + goto err_bailout; + if (test_bit(PIC32F_DMA_PREP, &pic32s->flags)) master->can_dma = pic32_spi_can_dma; -- 2.20.1