Message ID | f177835b7f0db810a132916c8a281bbdaf47f9d3.1699801657.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp732759vqg; Sun, 12 Nov 2023 07:08:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkcJlba6oqbwxIiMJCvseuBV1t5jnLHD6zN8uvf/RLsl8VI6U0TGzrDG4PDRpOjETG+ZjF X-Received: by 2002:a17:902:9b90:b0:1cc:4677:2f0e with SMTP id y16-20020a1709029b9000b001cc46772f0emr4999863plp.45.1699801699882; Sun, 12 Nov 2023 07:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699801699; cv=none; d=google.com; s=arc-20160816; b=dtjbmSCLjr6iYQ9s8rI6zBfdDnKgXdWWbtLCxqzi4M0j3LC4GW75mNSeVZ8R1sKUbt JXSujs+akcWNt7pIT1Tgu0mBz0cvgLf/XTJ1piInEJp1YDxlPgo2FwM121/FJlA47jDS Povbyo4ZGq4A2QRq/Pzo31bhiM5ddvxI7dPwlqYmLHa0gf7FW3O6d4Gu1LDOeoidT0sM L9PL6nh0/58xov5BDOjcQrKz76si51UVbghwNtKEYajZTmJ6gn3EG8Shkn88H1LvJ4s0 KQbEVPv6sOUMuFAzennNpzERuijwrW+WKe3QXdTL2isRqq74T4ePbTVi1Kv/dTKUKHkI 03aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HsPvZv0x+A3KoodF5NWXigZeG3z5ocFLVuOCH93t+Qg=; fh=e/wPvxxC3Cn5AeoSGvCzQtNh5YYkvxmVxJxB3aKQtic=; b=n4ChJf9dh2tAf55pIB2mqWBRigwakjjM3G/AcykGT5vQQ/sQXJnaN+dTu7bIom2uU9 4c8wS4cChLs2KbAQ5P1RX49nNb4VAepGWFGaJzKDtWoqUTpxIzuOwDgQ9wLeIGKlr2Vc cKMG7+9M6MG6/bkPSllnUy0ob1x5596WGtyEydvZ5d19ZD10BQ4adRc2uvO6nB2FjvFr 2aoPL5zArBg1wKqsXfXSep7pqkMc+KZ0lCvXD2ZI/1Wc/lJxbvKdMYTyfILLt93/wEWO 67kYk7vxgDVUXgXfZYlGWyciOOmTLkhIzp5FJ5FUivxevN0qbu9to3e4QTlixjozgcIO Jpdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=CyH3It+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j3-20020a170903028300b001cc54fb60fbsi3994251plr.396.2023.11.12.07.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 07:08:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=CyH3It+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0C461809871B; Sun, 12 Nov 2023 07:08:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbjKLPIN (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Sun, 12 Nov 2023 10:08:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjKLPIM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Nov 2023 10:08:12 -0500 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53F5A2D63 for <linux-kernel@vger.kernel.org>; Sun, 12 Nov 2023 07:08:07 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 2C4CrUKVuFh5i2C4CrGN2t; Sun, 12 Nov 2023 16:08:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1699801685; bh=HsPvZv0x+A3KoodF5NWXigZeG3z5ocFLVuOCH93t+Qg=; h=From:To:Cc:Subject:Date; b=CyH3It+lkPlnNtgWnGGIZlRHNIVvTEXPaf9I0NdXq2LolJUOESKjWozbDw47R37KF zUkYSWt6GBsiJCv6puZYCx7moe2Sd0fY72z+hsmxMznUeLnacVPG4zwiHHiv3I2M5l XgbulJd1u0Z4kb2opca5zN5Iq36XQOLl8CCSWL+UjOBjmg+ag0LAoIMFiZZmUn78tO +DR9EPRdddqo0uxgmJJDOI/AhdzMlwaJtVzw7t3m/N88fcmYRvJMGqNRJkXP/fc9I9 aMK0r/mLfJdkw6JbdAb/Ixqjvm6PU7a1/j94QAIa9u3ac5DkIU2k9ZkgCz3TVz1qnn Q4zKiXHv28r6g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 12 Nov 2023 16:08:05 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Sergey Shtylyov <s.shtylyov@omp.ru>, Damien Le Moal <dlemoal@kernel.org> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-ide@vger.kernel.org Subject: [PATCH] ata: pata_pxa: convert not to use dma_request_slave_channel() Date: Sun, 12 Nov 2023 16:07:59 +0100 Message-Id: <f177835b7f0db810a132916c8a281bbdaf47f9d3.1699801657.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 12 Nov 2023 07:08:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782371267743720127 X-GMAIL-MSGID: 1782371267743720127 |
Series |
ata: pata_pxa: convert not to use dma_request_slave_channel()
|
|
Commit Message
Christophe JAILLET
Nov. 12, 2023, 3:07 p.m. UTC
dma_request_slave_channel() is deprecated. dma_request_chan() should
be used directly instead.
Switch to the preferred function and update the error handling accordingly.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/ata/pata_pxa.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
Hello Christophe, On Sun, Nov 12, 2023 at 04:07:59PM +0100, Christophe JAILLET wrote: > dma_request_slave_channel() is deprecated. dma_request_chan() should > be used directly instead. > > Switch to the preferred function and update the error handling accordingly. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > drivers/ata/pata_pxa.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c > index 5275c6464f57..0c9c9cf63d36 100644 > --- a/drivers/ata/pata_pxa.c > +++ b/drivers/ata/pata_pxa.c > @@ -274,9 +274,8 @@ static int pxa_ata_probe(struct platform_device *pdev) > /* > * Request the DMA channel > */ > - data->dma_chan = > - dma_request_slave_channel(&pdev->dev, "data"); > - if (!data->dma_chan) > + data->dma_chan = dma_request_chan(&pdev->dev, "data"); While the previous API could only return NULL on failure, the new API can return an actual error. I think we should return the actual error instead of -EBUSY. i.e.: if (IS_ERR(data->dma_chan)) return PTR_ERR(data->dma_chan); > + if (IS_ERR(data->dma_chan)) > return -EBUSY; > ret = dmaengine_slave_config(data->dma_chan, &config); > if (ret < 0) { > -- > 2.34.1 > Kind regards, Niklas
On 11/13/23 11:05 AM, Niklas Cassel wrote: [...] >> dma_request_slave_channel() is deprecated. dma_request_chan() should >> be used directly instead. >> >> Switch to the preferred function and update the error handling accordingly. >> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> >> --- >> drivers/ata/pata_pxa.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c >> index 5275c6464f57..0c9c9cf63d36 100644 >> --- a/drivers/ata/pata_pxa.c >> +++ b/drivers/ata/pata_pxa.c >> @@ -274,9 +274,8 @@ static int pxa_ata_probe(struct platform_device *pdev) >> /* >> * Request the DMA channel >> */ >> - data->dma_chan = >> - dma_request_slave_channel(&pdev->dev, "data"); >> - if (!data->dma_chan) >> + data->dma_chan = dma_request_chan(&pdev->dev, "data"); > > While the previous API could only return NULL on failure, the new API can > return an actual error. > > I think we should return the actual error instead of -EBUSY. > > i.e.: > > if (IS_ERR(data->dma_chan)) > return PTR_ERR(data->dma_chan); Agreed. Christophe, please fix. [...] >> + if (IS_ERR(data->dma_chan)) >> return -EBUSY; >> ret = dmaengine_slave_config(data->dma_chan, &config); >> if (ret < 0) { [...] > Kind regards, > Niklas MBR, Sergey
Le 13/11/2023 à 11:17, Sergey Shtylyov a écrit : > On 11/13/23 11:05 AM, Niklas Cassel wrote: > [...] >>> dma_request_slave_channel() is deprecated. dma_request_chan() should >>> be used directly instead. >>> >>> Switch to the preferred function and update the error handling accordingly. >>> >>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> >>> --- >>> drivers/ata/pata_pxa.c | 5 ++--- >>> 1 file changed, 2 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c >>> index 5275c6464f57..0c9c9cf63d36 100644 >>> --- a/drivers/ata/pata_pxa.c >>> +++ b/drivers/ata/pata_pxa.c >>> @@ -274,9 +274,8 @@ static int pxa_ata_probe(struct platform_device *pdev) >>> /* >>> * Request the DMA channel >>> */ >>> - data->dma_chan = >>> - dma_request_slave_channel(&pdev->dev, "data"); >>> - if (!data->dma_chan) >>> + data->dma_chan = dma_request_chan(&pdev->dev, "data"); >> >> While the previous API could only return NULL on failure, the new API can >> return an actual error. >> >> I think we should return the actual error instead of -EBUSY. >> >> i.e.: >> >> if (IS_ERR(data->dma_chan)) >> return PTR_ERR(data->dma_chan); > > Agreed. Christophe, please fix. Will do. Thx for both of you for the review. CJ > > [...] >>> + if (IS_ERR(data->dma_chan)) >>> return -EBUSY; >>> ret = dmaengine_slave_config(data->dma_chan, &config); >>> if (ret < 0) { > [...] > >> Kind regards, >> Niklas > > MBR, Sergey >
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c index 5275c6464f57..0c9c9cf63d36 100644 --- a/drivers/ata/pata_pxa.c +++ b/drivers/ata/pata_pxa.c @@ -274,9 +274,8 @@ static int pxa_ata_probe(struct platform_device *pdev) /* * Request the DMA channel */ - data->dma_chan = - dma_request_slave_channel(&pdev->dev, "data"); - if (!data->dma_chan) + data->dma_chan = dma_request_chan(&pdev->dev, "data"); + if (IS_ERR(data->dma_chan)) return -EBUSY; ret = dmaengine_slave_config(data->dma_chan, &config); if (ret < 0) {