From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAAF4C432C0 for ; Thu, 21 Nov 2019 08:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C5502089F for ; Thu, 21 Nov 2019 08:40:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="yai/2WpP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbfKUIkx (ORCPT ); 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