From patchwork Sun Nov 19 16:22:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 166825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1727408vqn; Sun, 19 Nov 2023 08:22:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzqXUGZaV3cQrw7+V+FjGWUZB368Z7SK8Bleqgp9qWF0bYoN465XhdPjtAUccjbio71TOu X-Received: by 2002:a05:6830:1ce:b0:6b8:7eef:a236 with SMTP id r14-20020a05683001ce00b006b87eefa236mr6067800ota.30.1700410954650; Sun, 19 Nov 2023 08:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700410954; cv=none; d=google.com; s=arc-20160816; b=PZS2umvh2V1tfR7RanyZNvmBNeZbIRTKlXIWNCIJrQNLh+WgchLq/bYFvFIyzgimn+ u48rFrGpgVi/d3y6cL+fd6E0k3KLwrRY3oUjzzj/paFO0JvcTnv0Wc4WORjjIjsJRtSX M3wgYrwE8CJT0qljnjoQFfD57g/B4dlz5gxKdSeefREyaRS1V26hJG1AuAwMfsmnLpYE hUk1QIMRpcx4lr5QYFHp5oXUw1lSx+yDKI9vXSYUcUpcyu/ZNq6ykPeivsG4oxE18QMU ROOR4ij+cca6kI+d+BnyDl8vozAC9NnOvTryC7JUDmlNWj3wIF+PGOmrPOCP4afCNrjU atBQ== 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=kEuqgZIEPcB/w+zrez3UmGeoQW8VSNG01XU6Pt+hyqs=; fh=7FC6Wz7ns93TvJYZqImr9IMY8j8vgPsEtp53R7oXCCc=; b=mlmIpYOt1Gvl0VcyO6xVVEY72kKoxP9x2bn8vBo+95B9hA5I/WtM9Zjxs+2iBdiM6F /+ifFZONImXj+ojtqaQBzOLruJjc0nyt71f1hD0XuEmrvJ4AtIEMZJF8ppS8/AFn/Rwx CWQAqWU4qEywgp5wlXFnyDktMMsl64YlL5Wvac/9b0PaQljGTTKwM9EEvSoJswWVP4+v GpZyz/Mo7DHj9syU71PM2jVqF6jB+5XFQs3q+kT/aUukoZBAMgfrAXx7aqgOfg/tRAxY qjR+50bPtaLYnZpejL+xxeEjxVNH402kqSgSHyBGLKw0WSPaZ1JGgspZsSpFBRGPyb7S ktxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="enN28/GC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x18-20020a63fe52000000b005bddb417affsi6019514pgj.291.2023.11.19.08.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 08:22:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="enN28/GC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 5B5788095818; Sun, 19 Nov 2023 08:22:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231331AbjKSQW3 (ORCPT + 99 others); Sun, 19 Nov 2023 11:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKSQW2 (ORCPT ); Sun, 19 Nov 2023 11:22:28 -0500 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C043711D for ; Sun, 19 Nov 2023 08:22:24 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 4kYvrrFxYgbbT4kYvreJzl; Sun, 19 Nov 2023 17:22:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1700410942; bh=kEuqgZIEPcB/w+zrez3UmGeoQW8VSNG01XU6Pt+hyqs=; h=From:To:Cc:Subject:Date; b=enN28/GCg/o1MtohjakZQm91u1MvRpCSbQuHhXWFMR6UvfttSKKILWBIsfbftK5aA CowZAZeDniDETM4+CmkQOq+OVHiUhBEC+LHslvrat23jziV0EgQKbrRzukdfzcVwrH Lmvg9rsTpPuqXHPhgHcfut0o/Q2YjxYPc1XTTIp2B+Dc5+i9WESPIAN1/rw5WTCkKl tSNDNG/MbMBNND77Tl46u2cQERux4HBllG7ElqCF7BQTvPIY6PXo1xCDfJZ67efZPF mNGBosP2DFpJaAkpreGbS07hRlZnmcXAs73qtYybR5YDvtRoRm/+58bVlgN1EF813W f9nBg1Y1KqXqg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 19 Nov 2023 17:22:22 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Greg Kroah-Hartman , Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] serial: mxs-auart: convert not to use dma_request_slave_channel() Date: Sun, 19 Nov 2023 17:22:20 +0100 Message-Id: <94812f7063e4db5590254ec45fe9bb3c6569509e.1700410918.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 19 Nov 2023 08:22:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783010117252865165 X-GMAIL-MSGID: 1783010117252865165 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 --- I don't think that setting s->xx_dma_chan to NULL in case of error is needed, because their would be some other problems or leak if it was needed. --- drivers/tty/serial/mxs-auart.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 8eeecf8ad359..1bbe8f2e2fcc 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -904,21 +904,27 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s) static int mxs_auart_dma_init(struct mxs_auart_port *s) { + struct dma_chan *chan; + if (auart_dma_enabled(s)) return 0; /* init for RX */ - s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx"); - if (!s->rx_dma_chan) + chan = dma_request_chan(s->dev, "rx"); + if (IS_ERR(chan)) goto err_out; + s->rx_dma_chan = chan; + s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); if (!s->rx_dma_buf) goto err_out; /* init for TX */ - s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx"); - if (!s->tx_dma_chan) + chan = dma_request_chan(s->dev, "tx"); + if (IS_ERR(chan)) goto err_out; + s->tx_dma_chan = chan; + s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); if (!s->tx_dma_buf) goto err_out;