From patchwork Mon Oct 7 15:06: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: 13824894 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 10A9518BB90 for ; Mon, 7 Oct 2024 15:09:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313788; cv=none; b=CvrYXlBe4SSrNOu86nPOhoAi5/Yr3Xy/cu3/OD91TeUSm0VlyJzYAEBF4u7BkzeHp5DD42bnDBzGn2quk/Kyfy2EPgnhaRsIsd3NMTKFFOrG0J3rkamK9b4DwpRJWi34tAav0/i8CmPTiVrBBAdyOnff7P8CTaR8Q4yX7DApWZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313788; c=relaxed/simple; bh=GdFJbEH9FuHcHkDgW9w9j0RlEqZ4KkfewDrDe8HQ5S0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kwoNZBBN06hm0Ro6m6gYggmZiV7cGVBvQ8Xac5Pa5lMI3qE8hxuex7cwtq0GFmeVK2mq/qsWXNOZIzBsLAd5+gWwBPiGgT6C91gOGD9zZS2wbBmRsL05G4u9sYkH8J6E9ueCm2kj7UKV6uqLX+E6dUbZaryGJjLSztyir7KksC4= 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=EHRpfCYt; arc=none smtp.client-ip=198.175.65.19 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="EHRpfCYt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313788; x=1759849788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GdFJbEH9FuHcHkDgW9w9j0RlEqZ4KkfewDrDe8HQ5S0=; b=EHRpfCYthSgsmIBj/g/XCZYHa3d5g3L7Kuz3z8gcDMs0mRKorGgCfJ1m +G5EA2XF8pGMtwsopvrcMRMVe4R9R+31uYtJIWJ4hAhpOURmp0rUPMH4h 3hYc0NCiNGROdqBc5fd70Co5jToS/Tz92jptg2S3Vgc4r6CsFIJ1tRSpF VBDZqaD/KSZzO76pKAHDUXWGfwkJfPgTSuQqQ1lj1wPbrpWHenMI6kYYE Yd1Sg9NLGWGLWlNskyXJ7F8/EYALSzR5pkCHhTc7pA9yL3nGxPOpyhvxc ILl9ooL9m/i+GwouWgBt650aJffvYDDq9yAaHgB3O1Og6kweqJqP2F6Qm w==; X-CSE-ConnectionGUID: HCXx6q/0TZC3eIkvFAQ+0Q== X-CSE-MsgGUID: WpzBSibuRZqEpw3iMsJIWA== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346840" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346840" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:08:58 -0700 X-CSE-ConnectionGUID: EVLZ8vnYQ3+e6g0dKKK1lA== X-CSE-MsgGUID: 4tzqZlrqSAGNiQT0kZMEmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="79494665" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa003.fm.intel.com with ESMTP; 07 Oct 2024 08:08:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C116A27C; Mon, 07 Oct 2024 18:08:53 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , 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 Subject: [PATCH v1 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan() Date: Mon, 7 Oct 2024 18:06:45 +0300 Message-ID: <20241007150852.2183722-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> References: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev 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 Mon Oct 7 15:06: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: 13824895 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 A85661EB25 for ; Mon, 7 Oct 2024 15:09:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313790; cv=none; b=K8I5iHok5ohPrb9i5ratbVKshGApLdhVzdaHjve/H3JxuycqJ2axCK3LolC0y9NLUIC/Mk26tfysbOZVSwIGcDf9lMztDtQXtzD+kZSjpL2/NfVZwNgLOlFXqjtosK7kN50ZJLtB7apY3pvwdXDL4RE1lILR780iiYkwgarduF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313790; c=relaxed/simple; bh=v+m7u6xYkCBvtRWhJdg+uTuu7BjwAyMzFJa9C4zYqqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OAEbqWQr5/SdoBgVStop1iXD2VBQ0ZgrxUznjpyMIUXvRl77zE6x+ZuWqQRjWBTyM8lgyr4Y0H7UFqt7sXuSj7UxrStKhCpjBMSzGhBBCE9UewH3tmg+LmphfwgC2UeYuFRrkBGuBtsvf6ABxrYw1fMA1Dikzg4Dy/U04jQKoRQ= 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=lH5a7lDj; arc=none smtp.client-ip=198.175.65.19 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="lH5a7lDj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313789; x=1759849789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v+m7u6xYkCBvtRWhJdg+uTuu7BjwAyMzFJa9C4zYqqo=; b=lH5a7lDjEfkPmgfx+0NdnYIhP3IdCFO0F8fhBcMGSK8Y13NV33qYM+2W 55csq/9GyQYx+D6HEnTU6Us2sHCCKtPiFtVr8Wk0F3gipTvRHTfWYrFJh CTuEDExu7ksjKsPu0CVvobOcqae5LQj2lhpntiYPW2GBRqBWQBIP1Imrr RDTHJeLM81Ub8EPHabPKO2ND1yG2tWzXuWQNUpIZondziVbhQT01ETS3P g5Bn8faHMHqmK9+RfaNoQxMZger8pQrf5o7cd8Ie8RuoT/L1+hg2AMoMw bTJqXoi/Td5NjqAippwEFu9EAdFuFPVA6vUkVaSBYBO6bxf1iyh0yiWsW Q==; X-CSE-ConnectionGUID: yi5sGORkQSufiTvT6+Whkg== X-CSE-MsgGUID: AH6vIXE4Qw+0vBZTuegg2g== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346846" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346846" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:08:58 -0700 X-CSE-ConnectionGUID: N3tW80l1RxCuOo04E+yaXw== X-CSE-MsgGUID: JWCOqzuCTyCipaIKiLRelw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="79494666" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa003.fm.intel.com with ESMTP; 07 Oct 2024 08:08:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C68C337D; Mon, 07 Oct 2024 18:08:53 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , 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 Subject: [PATCH v1 2/4] dmaengine: Use dma_request_channel() instead of __dma_request_channel() Date: Mon, 7 Oct 2024 18:06:46 +0300 Message-ID: <20241007150852.2183722-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> References: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let's reduce the surface of the use of __dma_request_channel(). Hopefully we can make it internall to the DMA drivers or kill for good completely. 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 Mon Oct 7 15:06: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: 13824892 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 741CC1D7E50 for ; Mon, 7 Oct 2024 15:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313740; cv=none; b=MGcLiBY6IpPOxkPRVM2rzpaI+l8PNVbJaOzirFf9tAlk9BzlG+vpf0HqmdARtgRof3dwyYxV9srM0MCNbjA8AyacYCLY/lWlpk3xpofHDIU8qGdOLhw5LztKLmQ1NDI/hyWr19UM/hwiwo7536dIfUe8LENZMA7Xiy0Gs12ewts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313740; c=relaxed/simple; bh=qGhUu9mdJXXubW4rlkY8zXABwAVgp9j7AomaOvWbYPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jf01VlRPGEJ5Va4tJYSDS+gsGn52hUiRh2/WIPG+egHpgsdPlhRg8iVfO6xbrtXkRbLstvH98qDwwrf7h/ilMDoouvlC+q6+118l54adG2grDkJPe7V3RkM2C55eFqiLBo3c7Ou687fw5Q7FzhFs/UoS780p3S1SLf/I/DWIkkE= 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=fUtC010a; arc=none smtp.client-ip=192.198.163.7 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="fUtC010a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313738; x=1759849738; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qGhUu9mdJXXubW4rlkY8zXABwAVgp9j7AomaOvWbYPc=; b=fUtC010aCptcqUgAFlhBFvuvONgDlqdjv55UztED7WD/kG7mq4So5oGF a/ctamizbnq35zFcDl2bvpIYktgVZipzbJ1cL6HOkW0d9KNh+/tcAOd3N DmaHnhmFVPb1AldzkQAhrEFswa0ahpPotVvWq24xbkt0JLTVt90iCsXgH XWc98UIa6pqU6w5uo1NM0i0+8gc7BEvQ+4GP/C7+MnaGIZP/oBz4ua4MR LByMMg/NxjK5N6PweN6NyGntL4RvBDPm4iWhpp54wq6PHcquMdg3iE40s c2mNQDYVFIj2Y7dhuTNbULGvsLgEWjEOwpn2Ks4MSENeIsqY1tXsNOaX3 Q==; X-CSE-ConnectionGUID: x6EM8pU9QW+noSXU9U+Etg== X-CSE-MsgGUID: 6UtEFCzPSLGswNWKISo1TQ== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="52870239" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="52870239" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:08:58 -0700 X-CSE-ConnectionGUID: pm590HrVQSGvXKUrqLQhkA== X-CSE-MsgGUID: vHncrqsZQFCU65LpdBLbvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="80477332" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 07 Oct 2024 08:08:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DCC564FB; Mon, 07 Oct 2024 18:08:53 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , 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 Subject: [PATCH v1 3/4] dmaengine: Add a comment on why it's okay when kasprintf() fails Date: Mon, 7 Oct 2024 18:06:47 +0300 Message-ID: <20241007150852.2183722-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> References: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In dma_request_chan() one of the kasprintf() call is not checked against NULL. This is completely fine right now, but make others aware of this aspect by adding a comment. 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 Mon Oct 7 15:06:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13824896 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 268771D54E9 for ; Mon, 7 Oct 2024 15:09:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313790; cv=none; b=frpEeqg2mPuw691VxH/nmCYsdlhj0KBPnkkLc7CL4JAmYXpzMaZOFutHqpPkFGpdlcVC7XrKqYL6QB1yGLH29QoFCGmhhEABPBizuISO/koRP0kJxtWJoopyYwhOb4iNA3jFJasJo42MiH+D000a8kYo7wh0cp981XCObQajeNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313790; c=relaxed/simple; bh=jjUrqSMvD+TNkk6dISyjVWCLL2O2l9uhCDaFAXlWcKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q1KdUQPeCTKwWvpVpOCdmQcqsrE87dWDeRv2c2smcj/z5ogf+g5BWs1os1EVRO2whWvW3Oa4BhfuiR7lynfsbwBLgU8LyFaQPGoG1ggWi3jeAzXlNMVJFTmwRvSA/IobJDsjEpzjRpzoGlkdcPuzTJyGNXbPt6OT7U7CQSwEtIA= 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=OS+f84JE; arc=none smtp.client-ip=198.175.65.19 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="OS+f84JE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313790; x=1759849790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jjUrqSMvD+TNkk6dISyjVWCLL2O2l9uhCDaFAXlWcKY=; b=OS+f84JEVYwiaYFbAOJH/j0CylmIUBUIpGSY+W1CdUUzYem4q1jtbDTc E2CHagbbxRDOz6sA0t5KjZUtlZw34Tgtj+whL3kHTc00C0vIR5+Ek1JOx hRB4HhfbuCedRAi6G+HVle7oyPD2z34dWu7DjF1gYhqwwNZSS5I+eNB4S Ye/ZZ7Iylp1GxYWJkf772YwJ7IISixKptW/MZPsGvc1zTR6oM1zBgATBn bn/M0GZxA6iOik7NnzuGx4y2zDVxeX6VPqwsMZ8koLMSEMiW3Nmva0CsR WY1zlM305MFY41MQbz60tzu61RDCdWFEwS22sfHdubO8XvDz2wK4qFJp7 g==; X-CSE-ConnectionGUID: yVh02PkpSuuBP6gil3chhA== X-CSE-MsgGUID: Z0Z+LG4aR7S9W/74/UGHpw== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346848" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346848" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:08:58 -0700 X-CSE-ConnectionGUID: ewQNEzAwQ0GaSUbdLRDDZw== X-CSE-MsgGUID: VqR2QV4FQVKvxwDO3aRN1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="79494670" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa003.fm.intel.com with ESMTP; 07 Oct 2024 08:08:56 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EB25556D; Mon, 07 Oct 2024 18:08:53 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , 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 Subject: [PATCH v1 4/4] dmaengine: Unify checks in dma_request_chan() Date: Mon, 7 Oct 2024 18:06:48 +0300 Message-ID: <20241007150852.2183722-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> References: <20241007150852.2183722-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use firmware node and unify checks accordingly in dma_request_chan(). As a side effect we get rid of the node dereferencing in struct device. 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)