From patchwork Tue Oct 8 17:27:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13826765 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 97E3BCEFC38 for ; Tue, 8 Oct 2024 17:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P2CvXVrRqmh4sFqPBb+q9K3gAiwFS2lNPnQAePsDizo=; b=ouFISB77oDo+VbSIOqrNu9SP94 xKZIpIJsYjjR0II/r3uo4XvOusaqClPbzSNLbEszINmeDXfFTflFHBvDo8c+sP4t7qbe4+ch91n9D 1o8yEfLVhRP/y84/hgI9B9BTAsZyw+5QqyqN+ZJUe61Ws/8y+GRq4q+NGQte/WMwo+Mlq+ClVKKu4 MyODzRTgcWQ+8XZozjq+PEbDSLR8mQi4qWoVn0ejdMbqT8BU24JrGvarvuyZCZBPZqZSNjwVpLj2h YjtWDBl7cOzp0Itg5O2UuZWtVFcoInnJ80VtkuUlbUvff5iE/lvhCbqwBTU8tpuxX/e7CStz2hjk5 BPBwA86g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syEF3-00000006ghb-3XCG; Tue, 08 Oct 2024 17:43:25 +0000 Received: from mgamail.intel.com ([198.175.65.12]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syE6A-00000006eh3-3mN1 for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2024 17:34:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408855; x=1759944855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GdFJbEH9FuHcHkDgW9w9j0RlEqZ4KkfewDrDe8HQ5S0=; b=Xaqloi96FstvSMdsWBT+4uXN2pFQgYGFwhurXDkKqKS7L6rii4pZvRG+ xDhZZrvPjBj86XlvWAJyajCQ4UHGMwwXXGefyUIh6qFbEsLjkghot5Vmk vPKjiQYXYsHIpViVW72xPNNl+yT6cEeQeW6I37RsZg5HbjDPJzo0201yv RpBSNoaufFIvnnYSskRInAS/E7TZka4FPz8vtAss5XEcC+IXyWVNeVByA DO0sqx8+GbJLuHYvFCfS9pSrRRsanXsZ9CkWm5Y94SW/NfRq0mgQQISJM 4RExDAyO5huXFUjQFvF7bvgwHFhZ0Vd8f4wxDEPMHXo0eMzE/GdEimATy Q==; X-CSE-ConnectionGUID: C7BttPLSTISa2Ig/6Ku8zA== X-CSE-MsgGUID: ZuV+SQMPQwG73sFiU9NK3Q== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="39021971" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="39021971" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 10:34:10 -0700 X-CSE-ConnectionGUID: IPfCEXd2RD+i1AMSC6Ycqw== X-CSE-MsgGUID: wIGVkGbYSHWamGJJjY0pXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="99266644" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa002.fm.intel.com with ESMTP; 08 Oct 2024 10:34:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 806CE26B; Tue, 08 Oct 2024 20:34:05 +0300 (EEST) From: Andy Shevchenko To: Vinod Koul , Paul Cercueil , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andy Shevchenko Subject: [PATCH v2 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan() Date: Tue, 8 Oct 2024 20:27:44 +0300 Message-ID: <20241008173351.2246796-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> References: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_103415_000499_97C8C320 X-CRM114-Status: GOOD ( 12.02 ) 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 Replace dma_request_slave_channel() by dma_request_chan() as suggested since the former is deprecated. Signed-off-by: Andy Shevchenko --- drivers/dma/imx-sdma.c | 5 ++--- include/linux/dmaengine.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 72299a08af44..3a769934c984 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1459,9 +1459,8 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan) * dmatest, thus create 'struct imx_dma_data mem_data' for this case. * Please note in any other slave case, you have to setup chan->private * with 'struct imx_dma_data' in your own filter function if you want to - * request dma channel by dma_request_channel() rather than - * dma_request_slave_channel(). Othwise, 'MEMCPY in case?' will appear - * to warn you to correct your filter function. + * request DMA channel by dma_request_channel(), otherwise, 'MEMCPY in + * case?' will appear to warn you to correct your filter function. */ if (!data) { dev_dbg(sdmac->sdma->dev, "MEMCPY in case?\n"); diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index b137fdb56093..b4e6de892d34 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1632,8 +1632,8 @@ static inline struct dma_chan { struct dma_chan *chan; - chan = dma_request_slave_channel(dev, name); - if (chan) + chan = dma_request_chan(dev, name); + if (!IS_ERR(chan)) return chan; if (!fn || !fn_param) From patchwork Tue Oct 8 17:27:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13826761 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 5F998CEFC38 for ; Tue, 8 Oct 2024 17:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9CSLpERIGTW6g13AjmQVXV11PYDqSHseFaK5ZoKE+Kc=; b=1vm3PGJ35kKhAU7Cv6ZYhcMq8p fvAUTmvCxInj7I5tvJIAjwzCvfUW09nTa3JDzQavhpT6hwgXGe3tPKLSIG4tRnB9kiR4syEjmkQRD 8CisW8f3c6UPORiMulRDR5ZgF5lfqqm2pIALf8Il4pJijH2J30KonRsbaNpxWsbRckelmos2fH3Kg H2AVtNlQ3JMtm8dfFC84BQjXDUcUxnnF7vxLJ7F/SgXU4TBuj7g5gOBHwqT00vq8PhwlYxYiv1nwg fXf1SOCRkuYFTSPlUXFIksbFDaCkViXa/WnRFKCQvod0UYfh/vhevRtCsm/EomoMNsq8h55p/p1Zn Tu8V2rUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syEBD-00000006fnh-3kmx; Tue, 08 Oct 2024 17:39:27 +0000 Received: from mgamail.intel.com ([192.198.163.17]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syE6g-00000006eqi-0saR for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2024 17:34:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408886; x=1759944886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B/TiYEZ7U+o3cYkTkBVn+Bib/ZVSeLTnOP2By0iGMbw=; b=GnCUVh4clao6OkTO0EEcw/0wwgGJExSCdqSI+EQfzJ2k7AtJoWTwWEW+ udj/D0btXKyCF/WxMXenu/O2yhMoGO8v6LEGgo1nU3Ww7P5cNv+FfEkBY /xXGgsQKXn+aOuA5thFFA7nzIQtZyy9OyexJze/NCfc1ste0FnPXLe5n9 hOV/yHvazULw0qqetXTQcuaS+ASeZJrdQfvMCIUZyO5lxlFC+kRDX7Xbf cCK0G2jtS0RoTTOe9/mzvq2QH9ePG/eNR3SNwPTfQtuGy4TCyLtMY8G8/ vUTf97eSB1ziWmicAPDxjs1nJnCYsH5vvuaqkrFr88M1XWmcP5MzVB+Ye g==; X-CSE-ConnectionGUID: yHPHplGyQW6J3lqGtyWtvA== X-CSE-MsgGUID: Fee40Me1TdSrimlMdtb8XQ== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510132" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510132" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 10:34:09 -0700 X-CSE-ConnectionGUID: J0il/t0ETkOzzu2NEWoWNQ== X-CSE-MsgGUID: YANwed6LQT2JXyVpxKC+Kg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="106677514" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 08 Oct 2024 10:34:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 30F1F28E; Tue, 08 Oct 2024 20:34:06 +0300 (EEST) From: Andy Shevchenko To: Vinod Koul , Paul Cercueil , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andy Shevchenko Subject: [PATCH v2 2/4] dmaengine: Use dma_request_channel() instead of __dma_request_channel() Date: Tue, 8 Oct 2024 20:27:45 +0300 Message-ID: <20241008173351.2246796-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> References: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_103446_298334_2400026E X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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 Reduce use of internal __dma_request_channel() function in public dmaengine.h. Signed-off-by: Andy Shevchenko --- include/linux/dmaengine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index b4e6de892d34..2f46056096d6 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1639,7 +1639,7 @@ static inline struct dma_chan if (!fn || !fn_param) return NULL; - return __dma_request_channel(&mask, fn, fn_param, NULL); + return dma_request_channel(mask, fn, fn_param); } static inline char * From patchwork Tue Oct 8 17:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13826763 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 0D1FDCEFC35 for ; Tue, 8 Oct 2024 17:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rPo7yuMQUseeUfF5xw8F+I5twxmXEKkNF8gXD40MNsk=; b=pirDQTWjdiAVBg17GNVduWrisq OLzCC/recY8pKkr77U9f9aMEnyKURbnh153WqQ9WOVvP6lTAbvTwQENxh5n2znmM6WWWQKZe9wZUa v4D53RZcHUTPlGt3VCWGoQ9XY2ei2Dkv8mM/ylI1cQ5ZENpbAN3ltQO3WBbBd7f4ZB7i2ywjc2Vem +j0cBDrEnNORWDGogJAdHFZ9nqqGo9KryAIilJ8isFAdt8HHxiuVdjnJ+qpGHGWC4shOELs+ShofI z6gL1LphV34h5nAgQhjFTAiN8G8yYLfxT/l4k2StwVgMTTw3T6/0EI62Z831FZLIdAUMZinG8Ra3l j9cPXPwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syECV-00000006g6A-1hNU; Tue, 08 Oct 2024 17:40:47 +0000 Received: from mgamail.intel.com ([192.198.163.17]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syE6h-00000006eqi-2QPp for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2024 17:34:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408887; x=1759944887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M41KJpPTgtZC1kvfB0ok8XtGl6qr+rtNSYSFho5CTIc=; b=FXAZjBZZ1KHv4VCWAQPyutEIbQFBcg1Dp4UmGK3bjuFPN3iEiEbF+WSF wllj4g9sbhkTW+nIf473LhoI96rkgWYNbb+1G5GRuisRZwVnuai/5YC4D FMUgchTijK6mBWuDJm6ZoyD0YHyOiBN6BG+QKmU495ocxnZg6424fTN+K jBtd6+L86gujYyE/Azk7WNZt+DlpVeXmRjSxuYfNbgc/9trUBR7ImBqD1 54VzHOED4LTgCrG8MtLIYfg2ZW8LMwRH84vkQXpQiSOOfE01xYzlUZZdZ ot/RbpTSdRprA48UpEp8wNAkAJJ/QRffCSgMW8T9LhNYkUgVkR+xqytNK Q==; X-CSE-ConnectionGUID: uqF9FbtJTluTaBO9FxUD9g== X-CSE-MsgGUID: GYzSsKMlTPemzTExpjBdTw== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510137" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510137" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 10:34:11 -0700 X-CSE-ConnectionGUID: t8RFXAV7Sqyt6MzY8WQMWg== X-CSE-MsgGUID: zeSFKaSOS52rpb6wYKZVXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="106677517" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 08 Oct 2024 10:34:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AEE59347; Tue, 08 Oct 2024 20:34:06 +0300 (EEST) From: Andy Shevchenko To: Vinod Koul , Paul Cercueil , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andy Shevchenko Subject: [PATCH v2 3/4] dmaengine: Add a comment on why it's okay when kasprintf() fails Date: Tue, 8 Oct 2024 20:27:46 +0300 Message-ID: <20241008173351.2246796-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> References: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_103447_661480_94A9F089 X-CRM114-Status: GOOD ( 10.98 ) 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 Add a comment in dma_request_chan() to clarify kasprintf() missing return value check and it is correct functionality. Signed-off-by: Andy Shevchenko --- drivers/dma/dmaengine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index c1357d7f3dc6..dd4224d90f07 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -854,8 +854,8 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) found: #ifdef CONFIG_DEBUG_FS - chan->dbg_client_name = kasprintf(GFP_KERNEL, "%s:%s", dev_name(dev), - name); + chan->dbg_client_name = kasprintf(GFP_KERNEL, "%s:%s", dev_name(dev), name); + /* No functional issue if it fails, users are supposed to test before use */ #endif chan->name = kasprintf(GFP_KERNEL, "dma:%s", name); From patchwork Tue Oct 8 17:27:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13826764 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 117EFCEFC38 for ; Tue, 8 Oct 2024 17:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rjrvvQmo/fKDtVMvtCDb2bRjs6bfmJhMEvD/yxRPZ2U=; b=tlR0dU4j8ub8DzPYg6DEQp1nqG cyuwMncqo4vQ3JR4JbsvftiPh4VTlb7skyyvsABcw+juEx/M7w8Ea96F9Jw2AMM1x9yv20fdwmi1Z aFJuOK+YKq4kiNKfSYYP9/yWDlaFtc3VcWVgEwMsGbE+CYJpP6okgEpJbmUkqRzibRQU9PnK4Ubsl tPv+bZFb8Jyoe+4pblAse8+WC15qaVmi6cQhNLIfAWRUUNh5zgpEYRnsBBjaP+Y6F5RQa7K3cNUFw l6TmS2QeshKf1zIYC6CU+MnONLY8ZCQFwgRhHtFCvTEnIJziJ9Z8Ms/UOqdlA2m2C1gu+PZepFL5L 9F24gLGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syEDm-00000006gFm-06QU; Tue, 08 Oct 2024 17:42:06 +0000 Received: from mgamail.intel.com ([192.198.163.17]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syE6h-00000006erB-2xAZ for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2024 17:34:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408887; x=1759944887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LWWSgceP4b2NC/0ZlJaLRWZ5tS4LiVtbK0mjSJfEAow=; b=gadP+H/NjBdrfE3cf+22Px+0rg4Xfnc+hD5wwVAp3M86/ul4kTw1hDWb rukbHkeXfiS6Ekg2SWTsQdVhceUDtTIl1BdWSVzNBPzMQkkTbfQSRBY0F AS50+xG6mtNtvb5BNj/RcLLnms7TGeAbb/DuItuMwRPBiLyTQKj2k9qPh M+SvNskN2K5P/I1MWil5fM9PAZmhzWWOgUQ7QHPPNx88sKWOJFiLDPSli ql8ELOtqvTcXupNw+YzgrbjvTA8RPUgKzZdtmK092k1eD+uqcj/P/X935 ECceKmOpIIFWM2NprEokGaHGmwL8QUxZ9UPhJuKeSjUwX1cJzqHQXhVdt A==; X-CSE-ConnectionGUID: LRpyum8kQFKMfaV/Y71G0w== X-CSE-MsgGUID: bOGcQpJXR8m9n4ZXXM78zA== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510143" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510143" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 10:34:11 -0700 X-CSE-ConnectionGUID: xy4Hx6riRemFUqYdFdVEjg== X-CSE-MsgGUID: cCAzOXxJStCN7+sdvRCcCQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="106677525" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 08 Oct 2024 10:34:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 19901430; Tue, 08 Oct 2024 20:34:07 +0300 (EEST) From: Andy Shevchenko To: Vinod Koul , Paul Cercueil , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andy Shevchenko Subject: [PATCH v2 4/4] dmaengine: Unify checks in dma_request_chan() Date: Tue, 8 Oct 2024 20:27:47 +0300 Message-ID: <20241008173351.2246796-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> References: <20241008173351.2246796-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_103447_833685_BBFD9385 X-CRM114-Status: GOOD ( 12.54 ) 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 Use dev_fwnode() to simplify the check logic for Device Tree and ACPI in dma_request_chan(). Signed-off-by: Andy Shevchenko --- drivers/dma/dmaengine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index dd4224d90f07..758fcd0546d8 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include @@ -812,15 +814,13 @@ static const struct dma_slave_map *dma_filter_match(struct dma_device *device, */ struct dma_chan *dma_request_chan(struct device *dev, const char *name) { + struct fwnode_handle *fwnode = dev_fwnode(dev); struct dma_device *d, *_d; struct dma_chan *chan = NULL; - /* If device-tree is present get slave info from here */ - if (dev->of_node) - chan = of_dma_request_slave_channel(dev->of_node, name); - - /* If device was enumerated by ACPI get slave info from here */ - if (has_acpi_companion(dev) && !chan) + if (is_of_node(fwnode)) + chan = of_dma_request_slave_channel(to_of_node(fwnode), name); + else if (is_acpi_device_node(fwnode)) chan = acpi_dma_request_slave_chan_by_name(dev, name); if (PTR_ERR(chan) == -EPROBE_DEFER)