From nobody Wed Nov 27 21:25:19 2024 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 6BC241DDC9; Mon, 7 Oct 2024 15:09:47 +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: tUzxjHwkTLKRTROtq+ka/g== X-CSE-MsgGUID: uWx1fKZFQsqNok3oq8ZEtg== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346847" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346847" 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 - chan =3D dma_request_slave_channel(dev, name); - if (chan) + chan =3D dma_request_chan(dev, name); + if (!IS_ERR(chan)) return chan; =20 if (!fn || !fn_param) --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Wed Nov 27 21:25:19 2024 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 EED2918BB90; 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=ELvUvdW8yRrXvz1C2DO6vN2Eyh6MqkL1xyayqEQ1Mb2PB2/KZerqMYt/sHQyzT8ifehJhZRGiBYUCOSHdjwZ9Di0Sm4EJv/GkYzGFekYe7uqRbeq4UQOut7UZ/bHF1wReIHb/S2XX/Jf3OBivul0zixNyjp0hzwSxC/Yy8HBF/8= 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=HpFSARGh; 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="HpFSARGh" 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=v+m7u6xYkCBvtRWhJdg+uTuu7BjwAyMzFJa9C4zYqqo=; b=HpFSARGhcLRXbFthh952jMKiQ5sbUD4QK1QiV9eRvE0AIxETxc/v0lX+ kNr7ygkkgBtdzEm6287fbibNe3d9uLSQVz+kP1A9VMsn/h6uVZa7r+esU E8k+yas485kc4Uu+Dk/acwkXxOUWhnlF+2uKU4Yir06Jtyf8gR54tyJs3 oJlJvyDL1I6zUKE24SEO3LIuKn8yC1gGHdoKm9Aj29M4svgUK4ci2MBM9 b7GVUI31/hN2PcL6UAGiyCwrh439QZvYPAw/v+ITHrQRUPA5pgFI0jf8w Z2ahf0Uu36ZmMlgi9GxdMWjxX5c133KOuOCnFHLvKExjywfv5xeS2bmkA g==; X-CSE-ConnectionGUID: RZN2HHpGSTujrBVBTgCNxg== X-CSE-MsgGUID: k4S//Ph9Ss64t0C0O1+W4w== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346854" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346854" 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 - return __dma_request_channel(&mask, fn, fn_param, NULL); + return dma_request_channel(mask, fn, fn_param); } =20 static inline char * --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Wed Nov 27 21:25:19 2024 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 7416D1D7E3E; 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=1728313739; cv=none; b=FJjE9M7pnNDc1kg6Q63y5Z0/VEsiNBNfKjueN8S78PnQha+BPK4h1dXCKkxmwk9lrDQXdjOxC9lFh9rykirsZ2hiNtEyvOHvNmMEdHt8hFeKXXMSHEPUDbe/0Tqcpwu7g8MBXSlNOxNTkK9RT7VDi2Ln+ePDzYqpumQ8VjPgUkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313739; c=relaxed/simple; bh=qGhUu9mdJXXubW4rlkY8zXABwAVgp9j7AomaOvWbYPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UmlMQp7e2ivMnMN91ol+fffzDIPKT+TdjRsD/ojmhVQwckE73sbHc9aw0pIcye3LiYxI+2iHGx2bFltg1a9yrj4nWov6b8BxPZuhvIGhnpTzQD0wXntSJRzZVaz3MarpySg8EnrhYecSdbIGKsi9Lx6GK1UIG2b/R3/KrQRTL0w= 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=ecCXvmiC; 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="ecCXvmiC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313739; x=1759849739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qGhUu9mdJXXubW4rlkY8zXABwAVgp9j7AomaOvWbYPc=; b=ecCXvmiCkaoVySO+EwNAmA4IQPI8IY/byrrCVTIGp6nSLsZo8sBOCRL4 nobNQG/AV8zIlSydRRrcDIq4/2/NJZIgzXKXSWYNPK8A1E3AJ0KA11uDL q+5Rggq0ldPPtYKZ4aPw1mlm3yfBxXnUFgLcjoYIi5RkOd7NJwVtUENRE DjSIYNyvwS1u/IYJ+AMesFVWnffPmkKgvnZ0rW+FZVDL2RUrJxrw/QemW ItqAfdICPWgiGuMMMlkbFaAvz8nJh81Llt4D1XZkoW0ssMz0gtKYNlROx jQlZ7SoZK7MFQLQmLYjnJO8Tst21oQeknvOXZk7ukEE6f4fpVy5kit2/J A==; X-CSE-ConnectionGUID: 2k0zfLNwTOq22ty3htPmOw== X-CSE-MsgGUID: PBafyer4SLGjiwSgLvlsGQ== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="52870242" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="52870242" 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, c= onst char *name) =20 found: #ifdef CONFIG_DEBUG_FS - chan->dbg_client_name =3D kasprintf(GFP_KERNEL, "%s:%s", dev_name(dev), - name); + chan->dbg_client_name =3D kasprintf(GFP_KERNEL, "%s:%s", dev_name(dev), n= ame); + /* No functional issue if it fails, users are supposed to test before use= */ #endif =20 chan->name =3D kasprintf(GFP_KERNEL, "dma:%s", name); --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Wed Nov 27 21:25:19 2024 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 42ABD1D79BB; Mon, 7 Oct 2024 15:09:49 +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: MKQdVyOhR2qNA6dEK3fTcA== X-CSE-MsgGUID: Uf7BTGBXSGqg4usreYnMTw== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27346859" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27346859" 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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(s= truct dma_device *device, */ struct dma_chan *dma_request_chan(struct device *dev, const char *name) { + struct fwnode_handle *fwnode =3D dev_fwnode(dev); struct dma_device *d, *_d; struct dma_chan *chan =3D NULL; =20 - /* If device-tree is present get slave info from here */ - if (dev->of_node) - chan =3D 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 =3D of_dma_request_slave_channel(to_of_node(fwnode), name); + else if (is_acpi_device_node(fwnode)) chan =3D acpi_dma_request_slave_chan_by_name(dev, name); =20 if (PTR_ERR(chan) =3D=3D -EPROBE_DEFER) --=20 2.43.0.rc1.1336.g36b5255a03ac