From patchwork Sun Nov 19 15:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13460482 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64B1AC072A2 for ; Sun, 19 Nov 2023 15:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sP3X7IyHBfYX4oVwqvBsBxkEF/lWnjZs9nnuzqMLCF0=; b=YHkSBYnFGkeBFx CZraktvEg3TCPC40pjk/k5kEhgRlMx661kKM+6/j4jfZX9LuMzI2xyp2GRApeMSJxwZUlct/uoNAe ePCvJTSHkvJivpP8m/zgTWit2UZ1wjgBDx3+HSirYHUTyAwYBRZF2aSdN7C/Bmbt6BbdUfIxJJ1nk ozO5n1+DSaDFbgvXJUiFri/3Hhn9oq4BXEIEdLktJrdjL9X82A005BiGv9SBD8kCpEwDouNAakfJI N/Rm7V9fYPysZKsxI7aH3t7yHks+4Ghgx5UWIK9U1gMmAc2zIp+ULGDtUMUQt//xo9oYsJbNXRi5s I3bJXoB8k5EskvhnevNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4k8s-00AMQ6-2D; Sun, 19 Nov 2023 15:55:26 +0000 Received: from smtp-24.smtpout.orange.fr ([80.12.242.24] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4k8p-00AMPZ-16 for linux-arm-kernel@lists.infradead.org; Sun, 19 Nov 2023 15:55:25 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 4k8jra5LJxVPt4k8jrzYqY; Sun, 19 Nov 2023 16:55:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1700409318; bh=Pk/dqXN8wqk5MN1OczjCM6gfHKmZ2sdCVcd4g3SfGHU=; h=From:To:Cc:Subject:Date; b=DEIHA1P0nqzgSjkJf9O8nWTv/D9NfWyIw1YGskUroT1NBO110kk5Ozj5WEZ8ACT3Z gGl/iqRkvaIWUGv6Hz6k0SkX3rQMLlRtomZvUzAedUi7qyriZDF8WcOqxvOi1oItaD +58UV04puQ8nQt5eFa6RW3732cA55yvcLvNlK+DmBEkpxhMP5x035UmGy90wztY+kV aydw5TDN/DNbwMiwNIo5+NZZfux2gLPZB0t2b6C8SPQnd2U7JXF7JDJYiHbMN8aCy5 H7OtZnEj7t1jisCbbEJoozGPOTu+uHPTy1azyMhOKfWJb+FqH5GqIhG984M1MPXSf3 TFYAtCT9D6amQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 19 Nov 2023 16:55:18 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Richard Genoud , Greg Kroah-Hartman , Jiri Slaby , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea 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 v2] serial: atmel: convert not to use dma_request_slave_channel() Date: Sun, 19 Nov 2023 16:55:15 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_075523_926300_6A0B88C2 X-CRM114-Status: GOOD ( 11.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- v2: Also update atmel_prepare_rx_dma() --- drivers/tty/serial/atmel_serial.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 1946fafc3f3e..6aeb4648843b 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port *port) struct device *mfd_dev = port->dev->parent; dma_cap_mask_t mask; struct dma_slave_config config; + struct dma_chan *chan; int ret, nent; dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - atmel_port->chan_tx = dma_request_slave_channel(mfd_dev, "tx"); - if (atmel_port->chan_tx == NULL) + chan = dma_request_chan(mfd_dev, "tx"); + if (IS_ERR(chan)) { + atmel_port->chan_tx = NULL; goto chan_err; + } + atmel_port->chan_tx = chan; dev_info(port->dev, "using %s for tx DMA transfers\n", dma_chan_name(atmel_port->chan_tx)); @@ -1188,6 +1192,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port) dma_cap_mask_t mask; struct dma_slave_config config; struct circ_buf *ring; + struct dma_chan *chan; int ret, nent; ring = &atmel_port->rx_ring; @@ -1195,9 +1200,12 @@ static int atmel_prepare_rx_dma(struct uart_port *port) dma_cap_zero(mask); dma_cap_set(DMA_CYCLIC, mask); - atmel_port->chan_rx = dma_request_slave_channel(mfd_dev, "rx"); - if (atmel_port->chan_rx == NULL) + chan = dma_request_chan(mfd_dev, "rx"); + if (IS_ERR(chan)) { + atmel_port->chan_rx = NULL; goto chan_err; + } + atmel_port->chan_rx = chan; dev_info(port->dev, "using %s for rx DMA transfers\n", dma_chan_name(atmel_port->chan_rx));