Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2953780ybc; Thu, 21 Nov 2019 00:43:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxEgfrWIGNTAEC2z3Yto6SVGO86qsWnWcfgpWhdHZQ29NSkNw9GkFBytKLJWufXYtwP9Xye X-Received: by 2002:a17:906:8307:: with SMTP id j7mr11679782ejx.171.1574325794557; Thu, 21 Nov 2019 00:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574325794; cv=none; d=google.com; s=arc-20160816; b=EiHofS0VqHOqlwDYCIuPt/+VnYWuRMEZ3kxI7EC+Q3cleU7qxCBZqUy+rJsvZq7B+o clfWCaGVDxv9tkS8Kq5Cv2OcpcSHG/WKWOqSmwBfoZjLN4YCx4WNd2pTchk7CWDay1ey PCvOTK3l0D7DHmT2T/AAUZZgGgVZDevAaiKEPv+JmCtzS3IiIHjpxoDEaAtdFxLNKHeL YqXTOxPEevltzk97rmGrNsbu5LPW3MbXOKJ9IBrB2hodtd+Wi4e7Gmx3bnLYVt/lm2up xUcgUOAfG9+N2rX47nN+f4dx+xH8Dyk4BnVNzcFd9D7Mx7l7GR9cTV8ob0luTsHUmM0F HsjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=3pylHeaN7iP6cxBeTqVahG6KV6jdHcvq0KcnwEGK/LI=; b=comiR9Vy7pgVZUycXcG4L5YAHblu43+TMGiH07yfPjUgen2tcNOa3pbqwqM4ZewGbb 7PezDxeBOm/zO/vpO6N5rqYeQGnAk5Y5TdsLClqQdVxLChVNNGgQ6v6/7/4wQIjNbJkF 82Z2j6IBDtWGF1h0bNKvkYiym2zDTnhYLq0PtkO/b31HaTC/B4Y6lCK+NlCKDtKz2Kk1 6TxMJxOwgAo+uYprJk+GmBFZcFYeh1FIM2QExF6rx6SSai+bl3Hpuz+lH89dQe5s3ZN9 8kWqyAMmiZJAVRd7IyINksfzco2O6H8OVHjAEQc2716nEC7ZWWBu249rDlu3ZeXXGFuT insA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="yai/2WpP"; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rv3si1301714ejb.249.2019.11.21.00.42.50; Thu, 21 Nov 2019 00:43:14 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="yai/2WpP"; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfKUIkx (ORCPT + 99 others); Thu, 21 Nov 2019 03:40:53 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:49280 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbfKUIkw (ORCPT ); Thu, 21 Nov 2019 03:40:52 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xAL8el3Z123034; Thu, 21 Nov 2019 02:40:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1574325647; bh=3pylHeaN7iP6cxBeTqVahG6KV6jdHcvq0KcnwEGK/LI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=yai/2WpPT8zYSQ9++gVSogRTbCi+pMS2ua+nUCFcysWmgP6Q8biDbD5aSyFrKX1M+ ISqkkFs5dWettRGuHIG2vAO3xRHou12aNXokBdOtQYtgyHVEO385fOcGvJK5Tx/SbF 0zf0Cn5liOL6dpbvr72ODXWRUji/2FeCJ9C9tyVw= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xAL8elVs122541 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Nov 2019 02:40:47 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 21 Nov 2019 02:40:46 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 21 Nov 2019 02:40:46 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xAL8eikU059437; Thu, 21 Nov 2019 02:40:45 -0600 Subject: Re: [PATCH] spi: pic32: Retire dma_request_slave_channel_compat() To: Geert Uytterhoeven CC: Mark Brown , Vinod , linux-spi , Linux Kernel Mailing List References: <20191121080954.14915-1-peter.ujfalusi@ti.com> From: Peter Ujfalusi Message-ID: Date: Thu, 21 Nov 2019 10:40:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On 21/11/2019 10.30, Geert Uytterhoeven wrote: > Hi Peter, > > On Thu, Nov 21, 2019 at 9:11 AM Peter Ujfalusi wrote: >> 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. >> >> Signed-off-by: Peter Ujfalusi > >> --- a/drivers/spi/spi-pic32.c >> +++ b/drivers/spi/spi-pic32.c >> @@ -609,22 +609,18 @@ static void pic32_spi_cleanup(struct spi_device *spi) >> static void pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev) >> { >> struct spi_master *master = pic32s->master; >> - dma_cap_mask_t mask; >> >> - dma_cap_zero(mask); >> - dma_cap_set(DMA_SLAVE, mask); >> - >> - master->dma_rx = dma_request_slave_channel_compat(mask, NULL, NULL, >> - dev, "spi-rx"); >> - if (!master->dma_rx) { >> + master->dma_rx = dma_request_chan(dev, "spi-rx"); > > Why not dma_request_slave_channel()? The longer term plan is to retire dma_request_slave_channel() as well. With dma_request_chan() deferred probing against DMA drivers is possible and it also supports legacy boot with dma_slave_map. At the end we should be left with only dma_request_chan() for slave channels in the kernel. > That way you... > >> + if (IS_ERR(master->dma_rx)) { > > ... don't have to change the NULL check here, and... > >> dev_warn(dev, "RX channel not found.\n"); >> + master->dma_rx = NULL; > > ... don't have to override by NULL here. It is a small sacrifice, true, but if anyone cares the driver can support deferred probing with dma_request_chan(). > > (same for TX below). > > Gr{oetje,eeting}s, > > Geert > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki