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: 13826743 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCF1813BC2F; Tue, 8 Oct 2024 17:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408851; cv=none; b=Zi7tYZ9/kitNj9JZMQBs7flvN+ZKqp/o9TDJqtQLZl26vPXkMqpADUoVWRNavj17fYMuJNSO0zVuZf49d22ivYLGmA955aWse1d6sITdUVIKM4JCCpgCuKvOngmDTVlhkF5YcCKjgXhwj6NzccymH0ewA+XVI78YYK1e99mw4vE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408851; c=relaxed/simple; bh=GdFJbEH9FuHcHkDgW9w9j0RlEqZ4KkfewDrDe8HQ5S0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tpMxBvlsDlXBKbd6YcFPzDzR8uI26CitzNI1w0IoOUAGQFdmH7fOo5tSvkJ9wxZ0iaL06bPkx67bBXDq+XVl7jGAySxIjtvsDnXULgSaruVGhHFbugWaxGoBRCjd3MrDwCVdOfkFrK15CDXZoqLUIjwC3jgx6Cdk0pnEtYn/uwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WNolwQk0; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WNolwQk0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408850; x=1759944850; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GdFJbEH9FuHcHkDgW9w9j0RlEqZ4KkfewDrDe8HQ5S0=; b=WNolwQk0xA5XjkOzRHCVaI7quwA2lFRPYxuVF3vk24fFKVD4cNMmWySn aN9gAbIJG8jaQpBDu9HnHzeNFe7iq4eL6hiG6q5h13TTVQzW+CPt/UGCR Sc3zVDpWafwAlvSCzRKs2Pf6EGxdNbmbw33viPfom1XrAY3tLVpNCdQzB 7ct70XQmzYP8IlAqLyCkmZTlEVcoAt4LQfFVEzYoKwdGPFS/HvWBJrEri MevUPPVEg3MNStm5RulF6ggY2BcFjZKkvfjmR5/SYKNZ7Ucx7BHoCqNJa CX6Z1iG9GE2Ia4hNHHC0mNRT2xEeA287dEXT4S0JGSv+WVI4MUT+pz31G w==; X-CSE-ConnectionGUID: I3DyofyYSay70TNB1/h4XA== X-CSE-MsgGUID: jZOmaqiVRk61/INnOJEECg== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="39021973" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="39021973" 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> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13826757 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A01820A5F5; Tue, 8 Oct 2024 17:34:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408887; cv=none; b=VM7qTatx8OusvynBw+L84hFpoPGemRGPzvj9jY84kUu4OJFsvYKkCjiz08rm/c/SvdcC7l71SqvETk050ph1bDTgSequMsJjOKo7s2yHGniE8V+UgD65oFnNPMs1hc4+rwf4uNqB8X52zC00gqyD9FejXvpPqU2mLu26Gx9cSWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408887; c=relaxed/simple; bh=B/TiYEZ7U+o3cYkTkBVn+Bib/ZVSeLTnOP2By0iGMbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rit3PxSS0yQHtoSMZ500HUbe3LV/I3GiiY3hrRWpbf8OmmqbYNhftBMrl+rBUke05WdoNKJgngInCbdLbyvYj8oX2Ptho2g1K99XLOPlneUhLXo2tqy5z7yrBXtNq2Ef9VkTNqV2f1594+tp2Vona5vAqG++pI7/FZbr2lSOSxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GnCUVh4c; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GnCUVh4c" 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: CQnJEboOTRqXUnsh86Rx4g== X-CSE-MsgGUID: XiYP/GrkTwi+GqptWPoBHw== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510131" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510131" 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> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13826758 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB8FA20ADC7; Tue, 8 Oct 2024 17:34:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408889; cv=none; b=Vic0XDL7VLYU8PX8HMaL7W9M3cHHMb11Qj8AqPLnjSYLrnuFywSxgyrUl1cGd0pcU4pWekM/qljr3RgEISilH0VltMifK1er7/TTsU7BgoInyDOgyov3ybyE31PV8zpwRJMj0bROZ/lO1Uxay9xgA+h8IGrBvGENNR06rBYj+I8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408889; c=relaxed/simple; bh=M41KJpPTgtZC1kvfB0ok8XtGl6qr+rtNSYSFho5CTIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qnFL5lhUqKiRAPPXydNVWt/HPTKBx71WfsWj8+PMGJErnwuuxc/9C7rWtyxRzyVWmRuwAtN1iM81NWmkt3BSqmzTcNhUD6rn/PDqfJZeSScObmv1deyzEyS7JD8EwimuvhrOSoiT4tV85I8SuZFKCJdRd1H7M41eM3A/BZgv8qE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=khNb2y3/; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="khNb2y3/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408888; x=1759944888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M41KJpPTgtZC1kvfB0ok8XtGl6qr+rtNSYSFho5CTIc=; b=khNb2y3/3KFJhiMuR6U+sVg+JFoKAxjMDTVxrihTdYYoV9ShkNuCtINw OIoFjHW/BABbFX17v70xMeFo8FVxvUvAKaTgNSV2sFJ104di/Qfzo7ClU VF+Dss5yH72Bz6jwkafDuy5dxFzm5VDgp5cmajCNxfKFaOnPyCKpKWYAC oORWBf53h2/L90x0dhu3WJ0bV7qJoHS6qpWrtL4qcqGn7oolHCG5Kv+bK zOzIvRis2nw329urx89h1MQ2dCHuMnNHv3kFMjCn31Ld0gPoPr/on7ZUp /IJjWIoJiw8y/Q7BO6W8Quj5aSkFFiP9p4v8hNc3UahCMMmMuxHbCvfNz g==; X-CSE-ConnectionGUID: etGNj3fmRpeUym9tyyO3pw== X-CSE-MsgGUID: k7kRe0QYQKe07+rZe8guaA== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510134" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510134" 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> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13826759 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6520920ADED; Tue, 8 Oct 2024 17:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408889; cv=none; b=QX/9rrDD3dbPO379nmvMxPBSRni1QFZDvi8mxsLMKTlwKAPFaIxMMhTzxzPo7x5rOfPPpOuvGW7pVXyFyLuJCV4suaSZcXYAaV2/tJ+0H3lhrICJjsqNJTYTfQohVKXeC6J9AlcFTM/tF83n9XJADgqsQN5xljApYNJscoqSDDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728408889; c=relaxed/simple; bh=LWWSgceP4b2NC/0ZlJaLRWZ5tS4LiVtbK0mjSJfEAow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oRxVOAy3xSnTjej9zYYOdeWSU6nLkjPDmLOL7B+tfF4wjbA2AIh6tiYNuxo9YKLheZOI5qN3K1KXypPBAxN0SLuzKA97bj4CUMdlc4kDV8tKyQhPb/1hH2glvoF75f43O411ZRNws4jSR7qrKztJyLge0/LRyxiYyStxiFE/eT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WRODlFWZ; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WRODlFWZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408888; x=1759944888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LWWSgceP4b2NC/0ZlJaLRWZ5tS4LiVtbK0mjSJfEAow=; b=WRODlFWZ1WJl8b8c5/Ubqi6MSCT6tiKDMiEMt0OzvvvZySW/tS11NOFu GzhbwU1wzCJyfyyn+RfA4GQ4HPWSJgDgb8e7BtAs12RUBiJFmk/CLL14Y fhsUD/u1jv2pAIhvNUrJVwGPNj4/vawJ4uLTaZqNahcuzspWc87kESkyG XHIh1TMsMnw5i5dHlmaBjJTQ/+f5Y7ZL0jw8FWowUY+KNAlKr/w3m11PF 2CuwMiq9VRZqXCURo7Kygmkd76sIgSPUmMX3wPmaFYj4Z1yFnWlsUzw/Z BH1ibKbbo0OcmWRglcwWt4S1rzJ6S6RoE1Mmfy1fbwy/5ZjutKwmToEXc A==; X-CSE-ConnectionGUID: nCNGfjiRTBeNGYOajGFJqA== X-CSE-MsgGUID: TJDYri34Q9CoAvJr/9cM7w== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27510145" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="27510145" 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> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)