From patchwork Thu Sep 3 20:53:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 3171 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id DF3221C02C0 for ; Thu, 3 Sep 2026 22:55:51 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=NXP1.onmicrosoft.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-25554-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-25554-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id DA8032C8D8 for ; Thu, 3 Sep 2026 20:53:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53CB34FB9BE; Thu, 3 Sep 2026 20:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="ES26CSjC" X-Original-To: linux-sunxi@lists.linux.dev Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013066.outbound.protection.outlook.com [52.101.72.66]) (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 AE2CB429000; Thu, 3 Sep 2026 20:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.72.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468823; cv=fail; b=PWv7da4FfMlW3zEf3hx1NQRgAW2HktA8KG+snyhUsGyGijojlJfNsg2c+B1e6VrlgeUhgM9N+H8CibVctIZXe+zJc72rgMTO9y16G3ySMkPMrpOvuPjMStwPsQiYZpu36h2uoFP8ynM9blKNLDgcTBdNGGTwagxSbMcmQTcQss0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468823; c=relaxed/simple; bh=h60rf5UbjuSAb5W0ZT2gxInSKCjwoe1HMwHZDA9Wz7k=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=GJO34CyCHj/k3Jg51lFU9xibEjM50OjvooP3ENjglkanwfLl3TrGoaTj9PjEulPh5D2YyKUv/hcl4ocVkN/7e/m61dHOOquLSJETmuR67lwVDnq1iutWSMOLNtBAuSyYnXiiUmGAyHxZgRJaXnCVizVauY1jB79tt1VjtsdzFTg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=ES26CSjC; arc=fail smtp.client-ip=52.101.72.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D1eJUZdfSiCAqwOpYWBjfkyx/NiC0/7Kn7YzoacjeR9hPkjsGTOBSdCHfi+Xz+cmzTlqaZoWWMNWFlrlnXV4f+FEhikeFAlfXm90syDoA0kH6v0SfCN13l15nUBn6v86yfESNIfeGfIpAXEi4gkm0m3Ha0bMSsFgnkjq7zYaXeFSvC0ZVBtGQQ9zFHurWZlTjOTW6eqmq+6sxleR9t61yh3CGigUjkbZEXXXbZNrZhfj/UWwgz7i/nz2lt57yqGXzo6gXN//mSrrno9OiVb38HeH0PH6UM0WvbqAAwI1he2fn3el7Rksf/bPtwmqaNnuBahCYQW/rSN4MwBycZN9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xIrtL3aikHbKSqShfTCH663/0vOwr1XhVsAFtET2HvE=; b=htsX858/nFcROY2osj7kpjNXugw4hOTTzYjEw+1cLx5ISbdoffPVXSjHfZkJ8lkr5VbJaqmGAzE/OInzLoMknACbDIy5pTjOH3gSxUXL2U7sB909tpoE8VD8LeelGEJwwJPyeQ2J/6Wq1LwFGAa9CH74DJOKaKjKPPCkSUJ6u15afbiTju93zvODDEO591897nGE3z7TXv9rvcT8RfdJh9jzz3OAjt4XNflIE8ktQfvfGxzb7I06d0v9RnNK1rwd4nm6dSuMCiclPSnOmgSCsDHQPYwe+aNs/TIlZAqCY77dll8+WQyBa+fGudiDiKGXwIzNDdPnz2x8gsQfA/4zVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xIrtL3aikHbKSqShfTCH663/0vOwr1XhVsAFtET2HvE=; b=ES26CSjCXukk+XIx2fKj01JJ19hr6ySRUhOYlxxeKQGZPksTYRNpHMEjkzoONQ05Mw20QhKTSDmp/ultPZ4FLpPHIKdiYHLeP26qgM0DfdbGPnAYL/ERhLj+udwn4GpS+lr3VrqYSPKN4gxeifCRqN7vDn3+Vyfxg9izefGQrB+6mtycDAaadgf1tdomCizPCgpXPXrLsxSM2YRrS/X3slkpua8vFoDIyywyaVmBmrn/pZyEjwBgsf0RzZMIp12Maf8kCJeWLIt46uiP/bNbvP1VeHGqztVrRRek+JppQGpSxKwn9le3XgfPDgXRFr1d0ExL+O93unNAwibYJP5jRA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) by GV4PR04MB11894.eurprd04.prod.outlook.com (2603:10a6:150:2ed::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Thu, 3 Sep 2026 20:53:27 +0000 Received: from GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c]) by GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c%7]) with mapi id 15.21.0360.008; Thu, 3 Sep 2026 20:53:27 +0000 From: Frank.Li@oss.nxp.com Date: Thu, 03 Sep 2026 16:53:11 -0400 Subject: [PATCH v2 1/3] dmaengine: vchan: add vchan_chan_name() to get channel device name Message-Id: <20260903-dma-chan_dev-rename-v2-1-0db305b6c716@nxp.com> References: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> In-Reply-To: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> To: Jacky Huang , Shan-Chun Hung , Vinod Koul , Frank Li , Paul Cercueil , Eugeniy Paltsev , Andy Shevchenko , Binbin Zhou , Patrice Chotard , =?utf-8?q?Am=C3=A9lie_Delaun?= =?utf-8?q?ay?= , Maxime Coquelin , Alexandre Torgue , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Thierry Reding , Jonathan Hunter , Ludovic Desroches , Viresh Kumar , Keguang Zhang , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Kelvin Cao , Logan Gunthorpe , Laxman Dewangan , Vignesh Raghavendra Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-actions@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788468796; l=3695; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=8jHlCxUSDmTqFQA8Mc67+lAJmYQGqw16V760AwED3Qg=; b=bo2kXoZRCKprJEX7N9nUIx0ExG7ecn8AP/b21t9HeSQFuyu4JevCpVVqtXi/tpAmYDOrffmaz XyZFGDy9scEBG+tX+2na1KQs970joi0SK32VGcUVwEKY9IiPnmZkaLP X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: PH7PR10CA0002.namprd10.prod.outlook.com (2603:10b6:510:23d::28) To GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV2PR04MB11799:EE_|GV4PR04MB11894:EE_ X-MS-Office365-Filtering-Correlation-Id: c80ac412-16e5-48d5-ed5f-08df09fd671b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|19092799006|366016|376014|7416014|23010399003|1800799024|921020|11063799006|10067099003|56012099006|18002099003|22082099003|41080700001; X-Microsoft-Antispam-Message-Info: 0xkzsIMqj2L7OHaLJ5Mjgej2O5xHVkLOGwJYPEfZtUHuA8xC0c7G1ya6QhopD9FC0Wuj6g5/0ko7XWsL+m1HzO1SZ4wvQVXba/WAqkB16r8GRUTgDryfBY/I6TCQYLq/oyMu3V6ElEgcT4k3d4jrCnwrI5LLCWWOgyZbMvZjDKxyT2jHeKeeLdSXx33bNM8ICJFPD3fPHmUtuWekxOTAYdAsDeWCbpCkgizPSPA9vq9Gn1ps8gx1pVlKfG9qw1xOwDIBofdZVWm5A4E5g0mRfs1v1d7RDgv1Gann0Xcf8Z7lvjBEd25B+g4lNkQDGv/n66ivcKfSTMHD8hpJV9SqnTa/0xE8D4ar/DoypPPV4pEq1pkBhWRbA0awinv3LvnIbw8G5S6yKh6kYtTbJTpAqxsQSUCXgxXAr95494zFHO/K/HLBIbGdKJkzULJkf5BgYJrNx3WGXfcjuPR9WQugJdBhCZeuLgVq1NfHB9IhD5w0sXoxCK8LQAxgznL6XaYmofJVJSinYM7PyM4mrHP8+QuslDrN9iGv9vXbT29gt8NAZgLmD/Gl85SF+8JUt6xNASL/+AEgxOmIetRxZSSRmI24cdQfBSd5CW6i85eDHBoqudZGOIK0Jd0Phe5feq4HoKeOUqInTbd41xoNbD/BDXYSbJrQHAUjyRosbXA1oeQnfmgZrbpPb/3j4HJaK8qnUVt6GEyoefH+U1w6Agq1xIaFdUCQd07YNiOlDu9HPz97I5xK5pcmafNYqjcCa86U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR04MB11799.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(366016)(376014)(7416014)(23010399003)(1800799024)(921020)(11063799006)(10067099003)(56012099006)(18002099003)(22082099003)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6H5o9m9K4SPDAeMHik29wEfobcEt?= =?utf-8?q?l1XEa1BIevjYD09OX9ev7nFaJVXwat6DrstBMOqIbkVRVAJTKZvzY92T527fG+Ic2?= =?utf-8?q?fYuSGL+JBa/2cRlnxkiNDrbGKeayjCf6oecq2a1dNOzumwLTz56qLbxftwyUlIaIH?= =?utf-8?q?FtuZ0WjI2SOHGzk7jIvTymGzPTWzl58VF8AMY6PHNIS8pDVOH/x6arC2n1/Vo2PTQ?= =?utf-8?q?SnWWUqExEB3Up4nVYYWOpmO6bQhHnTskJi2p7qMfXatyn41rRaCVkgRTat+caYFcq?= =?utf-8?q?5wfGrXDgxAXsuBuzwtCw+tfJp9DTpd38RFrvcvnNs5aBmlM8JNLva/HqRsNR9iN8q?= =?utf-8?q?ohYDjaZ3ckKrsWmLu1nuHH6os4DBX2B9VI7S7OWKjtFmFUx/ojLLYXg+n6EACSuRJ?= =?utf-8?q?gaYQajL4/nMxyik5YgQzUMaUVbp+i8WTiiw2hoQlWX6jo7e0lpro3FSgBbsazvEHZ?= =?utf-8?q?8Lhz/KMB4LZgnnAGeQWojJHtFnUgpZQvjjHxKK8bZbDN2TTBgUqBhcDsNXcUO3Rhd?= =?utf-8?q?aK+yn5a1K1jHaXXVm/9V3MbY3SNATYr/f20tWsFrOQ4ReZWGBtHiMrnkJGUVTqtd8?= =?utf-8?q?zppQlXotM1buTXfmH+7wlBaYAaFsSeu3tnCUMFgoaV67e84oP2+T5T/NvrgG3ghxt?= =?utf-8?q?VAxRiu7vgyE4nKeheRL8P//hWCtOxHgWHISinrMKKVTH+w7TzzE+nzDWUT5RvvxDb?= =?utf-8?q?Z1uOQRiwPvhfjYqc6OZhJYFs2kqzlq4XQtK4ZrnbKRrUq3qdgtuvuhQYZFIAC8wfl?= =?utf-8?q?66Rv5JG3o+IESvwTAQUy+PSivgFLvSjlTmpjbtUrwN5pNyQvYQkeEMJ/YM9BW8di0?= =?utf-8?q?s4G/AIjRAvJGj9H1bSW3JSF0Vxh/nx1458/W/UcSub/n8BTNewNuhXVeYNrNDDUbA?= =?utf-8?q?U/8IMTv2yGwgznHfQpZbT+POgQ/qRA79ukMWVboXqbzLczAwKRXaa1oPvg/jjmKn2?= =?utf-8?q?8JRY2DUnFS0LJiluIElCEWXCkz6vBQen4xWZiZiMyQlxMs5HjPSuS3cUF+EsDdaNt?= =?utf-8?q?f4K+ywRxASfVbmnCA5jG2ZgSLKPGhy+lmiyZkTRKuUbH1BIZJqMxDxXe8t16e0xKq?= =?utf-8?q?tQs4pzUTpiFmMDXE4jGFvrcM8v9T2+iX6ZhAGesRxRB5OgMS7wa7PgkZWZPe+GYXN?= =?utf-8?q?Cg27up6W/68VH9DLCasY2uoEwPioSrK6zIOzlZrI1Q9ShpzjhdmGXt+k6HmCCGSB9?= =?utf-8?q?zaEFA7sicuKpa7vh07yHHnti+ub4mPhlU9By+ac6nMf+J1KFOouu2+Bxuwns2N3rU?= =?utf-8?q?xWHRCSgWC6RiBe8aevsy/gqvBdsJ6GYkCVmNmEfUq5Crb9rGwmx0fcaoHcGRAPTIM?= =?utf-8?q?RjRtB+qoW9JGTZ4nGIwrMO3xJzGU3qFRkwjzt7VQ5bC9TMDePjCbk2lrPhjvIH2E4?= =?utf-8?q?zoQBJCH+XCZdReGEqBJTxDyVEqe2KPSa5mggYcPWlfIiy53ZDmQOh8md6vDhAV9Sm?= =?utf-8?q?M5kNuc60F0t8Sace5NKthI4LPrGcmBhoVx5/qSANo0n+5JARDtxpIL39O1Q2Ru0YP?= =?utf-8?q?sZ5thKN1ulyu9iMI9JA0W0HTwdB1jhMse1k+2ohpQFNN6sfG/w3H8KDN3cCvkgED0?= =?utf-8?q?fJhbh8SFyuzXb3K/ehELXR686FiLkjjyiGKl6Wa9nzXuBSR1001Zjri1myyUsOUqM?= =?utf-8?q?xj0RFPD+ApBsKr2bWSgzbXXLfseyORm0uyXLxMjeoVGgehBmLFP9nF8KFxbM7i6WA?= =?utf-8?q?C5MjjjqLg?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c80ac412-16e5-48d5-ed5f-08df09fd671b X-MS-Exchange-CrossTenant-AuthSource: GV2PR04MB11799.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2026 20:53:27.2547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OeSoVYlj7G5klUkKzLoB4gX7vMJNIDJUe8nhSYlYPCv6pO3Evs+7qr4LdL/1+ENm2lHob7lYd0YT8JoONbxbu+2T1GNnXCEM7cbj1j2Vq/oVSLHD3IsTK4LfYT3RYxix X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV4PR04MB11894 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [5.34 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[nxp.com : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; ARC_REJECT(1.00)[cv is fail on i=2]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[NXP1.onmicrosoft.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[43]; FROM_NO_DN(0.00)[]; R_DKIM_ALLOW(0.00)[NXP1.onmicrosoft.com:s=selector1-NXP1-onmicrosoft-com]; FROM_NEQ_ENVFROM(0.00)[Frank.Li@oss.nxp.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2603:10a6:150:2cf::9:received,100.90.174.1:received]; TAGGED_FROM(0.00)[bounces-25554-noreply=patchwork.local]; DKIM_TRACE(0.00)[NXP1.onmicrosoft.com:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[nuvoton.com,kernel.org,crapouillou.net,synopsys.com,linux.intel.com,loongson.cn,foss.st.com,gmail.com,goodmis.org,efficios.com,nvidia.com,microchip.com,suse.de,zonque.org,free.fr,sholland.org,deltatee.com,ti.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from] X-Rspamd-Queue-Id: DF3221C02C0 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Frank Li Introduce vchan_chan_name() to obtain the DMA channel device name. Use a dedicated helper instead of directly accessing dma_chan::dev so callers remain unaffected by an upcoming rename of the struct member. Signed-off-by: Frank Li Reviewed-by: Logan Gunthorpe Reviewed-by: Andy Shevchenko --- drivers/dma/arm-dma350.c | 2 +- drivers/dma/loongson/loongson2-apb-cmc-dma.c | 2 +- drivers/dma/stm32/stm32-dma.c | 2 +- drivers/dma/stm32/stm32-dma3.c | 4 ++-- drivers/dma/virt-dma.h | 11 +++++++++++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c index 09403aca8bb06..52f5242ea3327 100644 --- a/drivers/dma/arm-dma350.c +++ b/drivers/dma/arm-dma350.c @@ -512,7 +512,7 @@ static int d350_alloc_chan_resources(struct dma_chan *chan) { struct d350_chan *dch = to_d350_chan(chan); int ret = request_irq(dch->irq, d350_irq, IRQF_SHARED, - dev_name(&dch->vc.chan.dev->device), dch); + vchan_chan_name(&dch->vc), dch); if (!ret) writel_relaxed(CH_INTREN_DONE | CH_INTREN_ERR, dch->base + CH_INTREN); diff --git a/drivers/dma/loongson/loongson2-apb-cmc-dma.c b/drivers/dma/loongson/loongson2-apb-cmc-dma.c index 1c9a542edc859..2f1c8c4fd0654 100644 --- a/drivers/dma/loongson/loongson2-apb-cmc-dma.c +++ b/drivers/dma/loongson/loongson2-apb-cmc-dma.c @@ -678,7 +678,7 @@ static int loongson2_cmc_dma_probe(struct platform_device *pdev) return lchan->irq; ret = devm_request_irq(dev, lchan->irq, loongson2_cmc_dma_chan_irq, IRQF_SHARED, - dev_name(chan2dev(lchan)), lchan); + vchan_chan_name(&lchan->vchan), lchan); if (ret) return ret; } diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c index d3ad78562a140..3e8151e2ad75a 100644 --- a/drivers/dma/stm32/stm32-dma.c +++ b/drivers/dma/stm32/stm32-dma.c @@ -1668,7 +1668,7 @@ static int stm32_dma_probe(struct platform_device *pdev) ret = devm_request_irq(&pdev->dev, chan->irq, stm32_dma_chan_irq, 0, - dev_name(chan2dev(chan)), chan); + vchan_chan_name(&chan->vchan), chan); if (ret) { dev_err(&pdev->dev, "request_irq failed with err %d channel %d\n", diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c index 4724e7fa0008e..1ee1bd22703fb 100644 --- a/drivers/dma/stm32/stm32-dma3.c +++ b/drivers/dma/stm32/stm32-dma3.c @@ -1892,10 +1892,10 @@ static int stm32_dma3_probe(struct platform_device *pdev) chan->irq = ret; ret = devm_request_irq(&pdev->dev, chan->irq, stm32_dma3_chan_irq, 0, - dev_name(chan2dev(chan)), chan); + vchan_chan_name(&chan->vchan), chan); if (ret) { dev_err_probe(&pdev->dev, ret, "Failed to request channel %s IRQ\n", - dev_name(chan2dev(chan))); + vchan_chan_name(&chan->vchan)); goto err_clk_disable; } } diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h index 59d9eabc8b674..dd023a3831209 100644 --- a/drivers/dma/virt-dma.h +++ b/drivers/dma/virt-dma.h @@ -209,6 +209,17 @@ static inline void vchan_free_chan_resources(struct virt_dma_chan *vc) vchan_dma_desc_free_list(vc, &head); } +/** + * vchan_chan_name - Return vchan DMA channel device name + * @vc: virtual channel + * + * Return: The name of the DMA channel device + */ +static inline const char *vchan_chan_name(struct virt_dma_chan *vc) +{ + return dma_chan_name(&vc->chan); +} + /** * vchan_synchronize() - synchronize callback execution to the current context * @vc: virtual channel to synchronize From patchwork Thu Sep 3 20:53:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 3170 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 481161C02C0 for ; Thu, 3 Sep 2026 22:54:29 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=NXP1.onmicrosoft.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-25555-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-25555-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 4AEB4617B10 for ; Thu, 3 Sep 2026 20:53:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70FE63CA4AF; Thu, 3 Sep 2026 20:53:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="rWpHpdU4" X-Original-To: linux-sunxi@lists.linux.dev Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013066.outbound.protection.outlook.com [52.101.72.66]) (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 151883793A8; Thu, 3 Sep 2026 20:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.72.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468831; cv=fail; b=ouYKet7TTp/XpkDX9q9W4w4fjbyb7M/MQOseMo4+dagRR7jAeLGd8oSVGTCGxAU6MU2xUYhOxLN0BDzGmYLEen8Gk0ScWNXQ8TuhktQjNgJqtcSMscjYXE/RLEkKVy6MyMjBMsOGLIIVphOJ4AdZLDwrNNoDaCVAso8vz2wK00I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468831; c=relaxed/simple; bh=0gmZ9uH8xVk/INqqbU45P96LKQoeN9AQ8Kqlk1PeZLg=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=MN2tksr8yfpzVtBOGk7P71Wbae3iB/E7hoaoHRWTl+KWRzzMgSfVTIr/ImoI+fe+RPxgzr66Roq2seRWf49qRrQxaOsCJu0W+S/qWZVX/8C1MLZb/m0PpifM86BODFQ5tNYpqkDYh8fGOPT/kHwXCr3qsgzWJcbsdl42XhEf8cI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=rWpHpdU4; arc=fail smtp.client-ip=52.101.72.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZjUXjXfuM7kyZZ8CAd+SMXdF6hmLQk+Bf6Cpxu4DOu4KlehVOVRDFfX1gK/g4KFfmL/DFyZCXgsY7fopjvJhMiV9ONit75ATgzDz1+WXNhY8F+7/9TpqQ9K3wcxbNWieVyp7ZAFy96A/I0KBiJtFsKEMiSsEjPEcfO/VirR21fmuTzZvZt4CwCfnbNVkR+5ZdXjKsesQ1xHWIMpFuRiBbb6lgGnzQBci7joS8QKiFWsSFyfRvrxfQ0xJ94xiK5sXNdi55dFKuZOigPvC7tGokG9BZQjpraKhOSt7YrP2Je7ESHU/WuapMIyIMzjY0Am2bkCCZlltzOXNBm8PmY5h6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8qP02nSnH5OFNSEU41007RiHO3PL9MvYi8mDl9ljJNk=; b=LvYhMQP5shLSOkbEGuN31VW4KQ+gprAnCpgE7TOm1M2MBAL4RbV6s2Id2xABV8ToP5RrpQu4cwPEaOKbGpThk0NGUxobzg4pv8xty+GfodMMN5sdYkD6DlLxZjpqr3WQJDDbfTjGpgdamwxQpe3p1Q2pBI3qPH5hgy2c97kiaxVbr0LutqeZIVqV2juARcsoYaU6T2NJldFDpQXyBMHvu4BGCNJa2IkcDUTgVIyyfEG2X5ZqRn+7P5cO8qEYxwe6zAgVV9ROoHjIe0eCrttUCGSH7NuYibb0HsGfBN50Mg+fHdQv2QFdrlMaotq8wD9EvAVESZG+zwfn++YRj3h5wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8qP02nSnH5OFNSEU41007RiHO3PL9MvYi8mDl9ljJNk=; b=rWpHpdU4bhDaNRCovK+T8Bdlue8+9JMG1x0G6luSa+IjvzHm7J8w0/iTe+8ZRGIlN+ZXpJLbwaV8v3arCuECwJJLDGkRZkcVPJwnD4pa/bcE5iMe1Mf2ihE6OeM/fZCA+TR715oZJbkcm52lhe9MXIEgd0ERg+rTtlJmsS8vEOT4cXWnVN3kN1dfacSz/8NDzPL/J1ZGyofEj15c8hTDot+Y7ALQOjn0hpXwdZ2fk2s1+QDzESYmYguJ7PCkbtb3FnkS7RyGm4Y1Yrmy15hISrlEtW8V+7UdvV/ALJFifuCsPm3c8so9/I4jAp1kLEL3cvv5tl1OaIKZF4RngLAXPw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) by GV4PR04MB11894.eurprd04.prod.outlook.com (2603:10a6:150:2ed::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Thu, 3 Sep 2026 20:53:33 +0000 Received: from GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c]) by GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c%7]) with mapi id 15.21.0360.008; Thu, 3 Sep 2026 20:53:33 +0000 From: Frank.Li@oss.nxp.com Date: Thu, 03 Sep 2026 16:53:12 -0400 Subject: [PATCH v2 2/3] dmaengine: use dma_chan_name() helper to get per-channel device name Message-Id: <20260903-dma-chan_dev-rename-v2-2-0db305b6c716@nxp.com> References: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> In-Reply-To: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> To: Jacky Huang , Shan-Chun Hung , Vinod Koul , Frank Li , Paul Cercueil , Eugeniy Paltsev , Andy Shevchenko , Binbin Zhou , Patrice Chotard , =?utf-8?q?Am=C3=A9lie_Delaun?= =?utf-8?q?ay?= , Maxime Coquelin , Alexandre Torgue , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Thierry Reding , Jonathan Hunter , Ludovic Desroches , Viresh Kumar , Keguang Zhang , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Kelvin Cao , Logan Gunthorpe , Laxman Dewangan , Vignesh Raghavendra Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-actions@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788468796; l=6794; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=/qlG6GU1Acam6GOeE+dDPCJ/BECdBAfo140IcCTsq/I=; b=nBWze121emtoyk/QNAMnf7ao8O90nlhlDhu3upjnd4w6MbJD97PbPkllTSLByawWAy/hBMtqI B3BEW7EuNYWAxyO2emTQzoc0Ic4i1uX4IRdQNG50cwpctEst5jkhwxR X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: PH0PR07CA0077.namprd07.prod.outlook.com (2603:10b6:510:f::22) To GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV2PR04MB11799:EE_|GV4PR04MB11894:EE_ X-MS-Office365-Filtering-Correlation-Id: b5396acf-c80f-406a-dce7-08df09fd6aa7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|19092799006|366016|376014|7416014|23010399003|1800799024|921020|11063799006|10067099003|56012099006|6133799003|18002099003|22082099003|41080700001; X-Microsoft-Antispam-Message-Info: wLOk2zT4DxwgLPR42hhAplfn7sivQ7ZvJgOqYTIDIjaQTL1ivTkCLK6S8VWofKL+SFi3BIQHqXk2nzUnX7YugwXljLQo1CRlXeH1MKwH0RIfQNCgjo+D6ztWPkOJBkATBs7D9mPGVSSLFO/PjFKeGI1y7JMS2gY8+JjCUjvwnIVh9MniDF9kcnAkkZwicSLzeSCMCNAzrpjbus0pI53dGvX/mUG+4eXNWzP9Rq24tBwYknnyeqLZpN0GIXGv5VtfoL7JzbSMZmwFaBXQ17p2J/StGxauR3RyOMh1SyjF+/PQ78xcmlGv5ceBcNtG946q4VOlwjvkiwaV2SxtiC/aEGoyxtr/+XzviDC5bvVF7Jshoc4DcoiJATap40H+eaEwQnE/X5JhsovGQYEs3WSagui5T5qTe82aT7Ykt9OUvIAamVipF7iwCmfVeLWYdZczdM3r9X/ArrCzOllqK0HPESt9DOwMtwXeHMAnDjR5Z4Yghdx5X9FGceFt4+LZRciK106UogGwQnu6xxgl/dltgit325OPe4D8ok/0EqG5lHcte6/C2/sh7gy1FHGg3RS7IyU5lFX38CYwQFPT06/9pn9lZBoR2kk20XnCdr6TK//DMVHUHx57ssPF9JwwkSskfpxRf7t7CnhFiADUlESESOYR8a1aCOhjKzKw4DROFCd5EREn6wyeA5X0BWYj3MjTlghHcxE0302DZptfefGWvsvQvO09xkSm+PDbpt17rc4KDNAJPV41YoLwf3N7H1g9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR04MB11799.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(366016)(376014)(7416014)(23010399003)(1800799024)(921020)(11063799006)(10067099003)(56012099006)(6133799003)(18002099003)(22082099003)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NAN0WaEE8XiqxnKcnk4fknwFt1aN?= =?utf-8?q?UN1YCpz/OIji2sabxtgB7tzCx2QwLiRjCo7dUcRuElEtXKd+wslqaTCCZe8WK0VAx?= =?utf-8?q?XOJyzU9w6NbMg7Y5E55j+ahiFJ3vai2jIuvdXXZIfj7iqX0CT3L1RPBblntgaymhn?= =?utf-8?q?W8Fs/sngedGte2mopnweK5aNmkPTk/Hj+bOLK86iERddGcVWIRpDJbRJ0rkS4kGFe?= =?utf-8?q?50tjYINrZRgd8+1AB2XzhpgB1Ae9dDT2JsG4/QIkCJkMj5Nbcy6B1Ko0Sz3ZjbONp?= =?utf-8?q?N/SK5mS5G1XiMI/U7nV1ZaaN9GMVhGeLEKh9skOoJQkS6/9dzz0WKZiwivFJTww5e?= =?utf-8?q?5jH1zh/CMPQWUt/n5mUf58XiMmovo2sBEGr1FJbZtKTbYRHMzPVKdPd7DZWfEwMF5?= =?utf-8?q?h+tnmNHdE6KGBjlgTpRoW8F5KVadPQkuFWU2TSfF+wVntVTZkxscO6IgWwnRIDITq?= =?utf-8?q?wwI/ZV1MA1KjxDvaZZATqFaSeDukn3I+mVofM+2pvNj/JFQYA+EoCBQOk21CiB06N?= =?utf-8?q?Aj80xOM7pYZfw0f4Aph9nMUbKAFYYBjpq2d3sr5HtbXvGodSex6eWcIWXNATxcSkl?= =?utf-8?q?kInG4q9j8AnduuZPB1sdoKlJeyM4DZC1JCHifJttQrWZvO2zUdmEXIgg6btD72YpX?= =?utf-8?q?bdXBRxvb3nn/mnBf9Kn+oOEwRlgDNVrGFGB7gfdOBCkMi5o+b6wFU6P8987oicKSD?= =?utf-8?q?O53AIn2TWSsDFPAbgPZDqlhYSJsV8QYaVeDymLePmysEtE7i30W9VP0m3PjNL995g?= =?utf-8?q?tvil2RAYwnpxryCF7/JJeLpeR5FbrOuaTJh0mr9roHNWbDZn6i2kO1EW5fpG6Jhpr?= =?utf-8?q?/n3L17E85UQTRTVJ7ItJJbq+hJJD9jTsvh/TFjeKGVWa6KUP5OFkyAbXyauyR7PiM?= =?utf-8?q?1t9MaVHIPE2NuLzGd2Z1nld4Cqk7fANxAKyCexj7sNllY1coDGIGfGaOkYraL/LAN?= =?utf-8?q?9GMzDMqM9oIrxrLjdXonqZVdM6Wpt/jsdGk418jJ01RKRPZBEiyZCsGeXgvkbM7/v?= =?utf-8?q?2mxc7+/CIbvsOgV6NGY2bP569h/YDCG4CoV9LYRzIb7Yeuc6v8TFE6CZOykAoNMai?= =?utf-8?q?FWLBJup++Tn8fZUWnHCfjCm6E9SkzZFwGjMxaccG2dWohw91hTvyuQvgE8LM1xEU1?= =?utf-8?q?rHzJdMTXp1hRHc4LbOKA5cON3Iz3yVDP6LOoqvAvWIMFtSsA+Y50pcTnrwkTczipc?= =?utf-8?q?m/ZUQ1CFZ0mjA1ePjlbzCwwThaZ3C6ScbNYNYQJTDoR++i1fygdgArfBMKVJ+lnvi?= =?utf-8?q?Owwk7U2DueLSM66q+p5U8PXtxpHFuDWG6GofZZ5/+NDfxvGyWWEH7YxD7mOsQwh2y?= =?utf-8?q?AJb0pM1BEP6a8XmMwSiMOTOjVDn0yivAKIg0tbjCc2WklQIH6HIPchPv1RUGC9GGg?= =?utf-8?q?MIsScYlYvqmA+w9hF2PFqLh0+YvGAKaYP905ZfT6UkEjCQZM/7WB4uV/GKEFnsgNN?= =?utf-8?q?2jNKTWHiWG3LW+HLbJfuZEC9OCut1fjfY682bljGyAFwb9Lij8Bqp/51kA7ZKuX+s?= =?utf-8?q?7BFky+14+uCZKWbTFb7ZPnWEBQX72/2JA1OlZmkbbMuvEYYpAYOYlW1jfIUdNXUhu?= =?utf-8?q?CkiUkQcIqYPg8UuUJH+J83p4czs5Ph82OUC6vI3pI7GtIrqQyfWXsjMmDqo5ZRhK6?= =?utf-8?q?astPYALexMxPJh8lsetUO6jlchOWVTXoLaOravPBOgeQzGQFjyn65miyix7JeEmEM?= =?utf-8?q?APQP/oXMi?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5396acf-c80f-406a-dce7-08df09fd6aa7 X-MS-Exchange-CrossTenant-AuthSource: GV2PR04MB11799.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2026 20:53:33.2120 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nFUYRVzVhfH0YHOG+ZIeTKQkjKSD2U21DmqSEl7Oru9lfbNYhA4wmRSyctSGKR0I+FU3sekjz6z5FfbG1f5V9GaV/l2SoTay83/lvuUk+f9B45qmHpUWC+CI1DsO66cE X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV4PR04MB11894 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Frank Li Use the existing dma_chan_name() helper to obtain the per-channel device name instead of open-coding: dev_name(chan->dev->device) / dev_name(chan2dev()) Simplify the code and improve consistency. No functional change intended. Reviewed-by: Logan Gunthorpe Signed-off-by: Frank Li --- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- drivers/dma/idma64.c | 2 +- drivers/dma/loongson/loongson2-apb-dma.c | 2 +- drivers/dma/mmp_pdma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/stm32/stm32-dma3.c | 2 +- drivers/dma/stm32/stm32-mdma.c | 2 +- include/trace/events/tegra_apb_dma.h | 6 +++--- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 6070dfdb7114c..194649811d02b 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -760,7 +760,7 @@ static int jz4780_dma_alloc_chan_resources(struct dma_chan *chan) { struct jz4780_dma_chan *jzchan = to_jz4780_dma_chan(chan); - jzchan->desc_pool = dma_pool_create(dev_name(&chan->dev->device), + jzchan->desc_pool = dma_pool_create(dma_chan_name(chan), chan->device->dev, JZ_DMA_DESC_BLOCK_SIZE, PAGE_SIZE, 0); diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c index 9c21a5479437d..7b50ba507cb02 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -531,7 +531,7 @@ static int dma_chan_alloc_chan_resources(struct dma_chan *dchan) } /* LLI address must be aligned to a 64-byte boundary */ - chan->desc_pool = dma_pool_create(dev_name(chan2dev(chan)), + chan->desc_pool = dma_pool_create(dma_chan_name(dchan), chan->chip->dev, sizeof(struct axi_dma_lli), 64, 0); diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 5fcd1befc92da..6399fd5408be2 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -507,7 +507,7 @@ static int idma64_alloc_chan_resources(struct dma_chan *chan) struct idma64_chan *idma64c = to_idma64_chan(chan); /* Create a pool of consistent memory blocks for hardware descriptors */ - idma64c->pool = dma_pool_create(dev_name(chan2dev(chan)), + idma64c->pool = dma_pool_create(dma_chan_name(chan), chan->device->dev, sizeof(struct idma64_lli), 8, 0); if (!idma64c->pool) { diff --git a/drivers/dma/loongson/loongson2-apb-dma.c b/drivers/dma/loongson/loongson2-apb-dma.c index aceb069e71fca..7c3d7c3273955 100644 --- a/drivers/dma/loongson/loongson2-apb-dma.c +++ b/drivers/dma/loongson/loongson2-apb-dma.c @@ -282,7 +282,7 @@ static int ls2x_dma_alloc_chan_resources(struct dma_chan *chan) struct ls2x_dma_chan *lchan = to_ldma_chan(chan); /* Create a pool of consistent memory blocks for hardware descriptors */ - lchan->pool = dma_pool_create(dev_name(chan2dev(chan)), + lchan->pool = dma_pool_create(dma_chan_name(chan), chan->device->dev, PAGE_SIZE, __alignof__(struct ls2x_dma_hw_desc), 0); if (!lchan->pool) { diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 386e85cd4882a..6b29e15b0616c 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -565,7 +565,7 @@ static int mmp_pdma_alloc_chan_resources(struct dma_chan *dchan) if (chan->desc_pool) return 1; - chan->desc_pool = dma_pool_create(dev_name(&dchan->dev->device), + chan->desc_pool = dma_pool_create(dma_chan_name(dchan), chan->dev, sizeof(struct mmp_pdma_desc_sw), __alignof__(struct mmp_pdma_desc_sw), diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index d9547017f3bd6..35dbff5f9f1ab 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -268,7 +268,7 @@ static int st_fdma_alloc_chan_res(struct dma_chan *chan) struct st_fdma_chan *fchan = to_st_fdma_chan(chan); /* Create the dma pool for descriptor allocation */ - fchan->node_pool = dma_pool_create(dev_name(&chan->dev->device), + fchan->node_pool = dma_pool_create(dma_chan_name(chan), fchan->fdev->dev, sizeof(struct st_fdma_hw_node), __alignof__(struct st_fdma_hw_node), diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c index 1ee1bd22703fb..6ee7a1435efb6 100644 --- a/drivers/dma/stm32/stm32-dma3.c +++ b/drivers/dma/stm32/stm32-dma3.c @@ -1126,7 +1126,7 @@ static int stm32_dma3_alloc_chan_resources(struct dma_chan *c) goto err_put_sync; } - chan->lli_pool = dmam_pool_create(dev_name(&c->dev->device), c->device->dev, + chan->lli_pool = dmam_pool_create(dma_chan_name(c), c->device->dev, sizeof(struct stm32_dma3_hwdesc), __alignof__(struct stm32_dma3_hwdesc), SZ_64K); if (!chan->lli_pool) { diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c index e3bbdc9ee36ed..c274638e919c2 100644 --- a/drivers/dma/stm32/stm32-mdma.c +++ b/drivers/dma/stm32/stm32-mdma.c @@ -1484,7 +1484,7 @@ static int stm32_mdma_alloc_chan_resources(struct dma_chan *c) struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan); int ret; - chan->desc_pool = dmam_pool_create(dev_name(&c->dev->device), + chan->desc_pool = dmam_pool_create(dma_chan_name(c), c->device->dev, sizeof(struct stm32_mdma_hwdesc), __alignof__(struct stm32_mdma_hwdesc), diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h index 6d9f5075baa3e..c38117c127ef3 100644 --- a/include/trace/events/tegra_apb_dma.h +++ b/include/trace/events/tegra_apb_dma.h @@ -11,7 +11,7 @@ TRACE_EVENT(tegra_dma_tx_status, TP_PROTO(struct dma_chan *dc, dma_cookie_t cookie, struct dma_tx_state *state), TP_ARGS(dc, cookie, state), TP_STRUCT__entry( - __string(chan, dev_name(&dc->dev->device)) + __string(chan, dma_chan_name(dc)) __field(dma_cookie_t, cookie) __field(__u32, residue) ), @@ -28,7 +28,7 @@ TRACE_EVENT(tegra_dma_complete_cb, TP_PROTO(struct dma_chan *dc, int count, void *ptr), TP_ARGS(dc, count, ptr), TP_STRUCT__entry( - __string(chan, dev_name(&dc->dev->device)) + __string(chan, dma_chan_name(dc)) __field(int, count) __field(void *, ptr) ), @@ -45,7 +45,7 @@ TRACE_EVENT(tegra_dma_isr, TP_PROTO(struct dma_chan *dc, int irq), TP_ARGS(dc, irq), TP_STRUCT__entry( - __string(chan, dev_name(&dc->dev->device)) + __string(chan, dma_chan_name(dc)) __field(int, irq) ), TP_fast_assign( From patchwork Thu Sep 3 20:53:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 3172 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 507391C02C0 for ; Thu, 3 Sep 2026 22:56:26 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=NXP1.onmicrosoft.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-25556-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-25556-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id D80933CCF6 for ; Thu, 3 Sep 2026 20:54:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47E40503BF1; Thu, 3 Sep 2026 20:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="LCHE8TNm" X-Original-To: linux-sunxi@lists.linux.dev Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013066.outbound.protection.outlook.com [52.101.72.66]) (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 280F346C83E; Thu, 3 Sep 2026 20:53:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.72.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468838; cv=fail; b=plrkczR5tIUDSIEkXUzE+LWfDkAWkKkOF3f8P5hPNDvxO1B1XOfFiEpVqh/MMtr0lTsvNK5hvfqPr6nCZhx5ESUV2n1WLak9fUd+/FPTYKdBp+Cba4RYFlNxQmtw/jxwy9Jb/DB+nc3HwYVt3jBjdtVFGjr8xLhtXkCz6wD4dvQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788468838; c=relaxed/simple; bh=iRNWmllqGzpHTZ/pND7cikRs/wKxpBewCk8oti/s5R8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=bPLYUyMIfPmH6uMMgu5XfPE6m6GmDKB4bMu87d8nnS9zJ4k+L7wnC4COArsJvu5FDyJXwI+9ovtfZHolRhUg2JydeU/WnLAelHIlOipBhRzS2DgMms5tTErR3xYIhj1FEBK41T4n1m88ogXbVuwpo7mDf77/AQx3qNqET+Byf6Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=LCHE8TNm; arc=fail smtp.client-ip=52.101.72.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ADSwT22ojeYV4ecMuGb5pfpJuZMqUaOQgrV+5gUDY6tOQspmGO0oYQJoquyPA8lImYN4jHRc70P2w7Ws1gE97WiAj2yyjBUbKvWxuLLc3RNIfcMVaBLsyQHRyUxqkUjlXNsEencsN8y8rGgj/rg/j6lExnceSf7yxJfd+8TWwM533iBNyy4aboG00Jh/au40jf6NvgzpjMlAneWCgRirhnu1A+WvGw07Db8NIQu5VrWP8q43Mo2qx1d6JouMic0FuIa2DR97SGEUf2K+0ZdFgfQ/4/nBMxYWAA/yOqk7i/plNvgI+plewM6szjaZS3CB1pkeetyX7ERxWuFT63ZOig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KLoxmu5JHY9gdVSoRX4JfMuzPCjWqHeOZQ1d1gH1cUM=; b=Lg99oC4K4Ijsxjm7+KMfA6yTZCV+uvFSsAgzqeT+zPey3dzMU1elYFd1NULRRDJyldxj7yDM+q9emV0LGe4Uvd6ot8XojajkfDjkNHUetVZtxXUVOrVwNtlPbcURg0sQbDkzIpVSlBKGrhEJHWoM6elq2BEHBdb2VR2GnHUObzp4PhyzFmcvuihqup8N3oQkzyk8LLBEGR4qpsAxtGke/CJOyj6w0ybU6ij22wX9u8K0f2XZ4pboOMpHWsTPS0FIswPGwuK1Klx45sz03ZJKtVjJ2fL53EMbB3S28Eq/jm3j+B6odxz63QW26K2FigwTcS4V8dLSgT/8hD+JcxUKTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KLoxmu5JHY9gdVSoRX4JfMuzPCjWqHeOZQ1d1gH1cUM=; b=LCHE8TNmLCTwafSQjRwR/RlBPX59I3EbwtZL/M1Q/tu/9fBL4Ml5nfDFFHIfKRpIJHpXHXA0zBL8dhBn8ZWoZ5LE9nwfLaU+Q0WVA277NAC1iRthgWcTLEKSH84SBtTw6g9wikaqvwlzDsocQnOf2lz5x+C33zndy32hGNFnXwNoUiEC5rfNbLhOTI1qZNI3oIM3WjKkr5t9OmGfJkdC19ApVyxMOyUSTbEIXZub6uwxQNIhrqk+bSaIGWfXH4eRuI/mgmyP32oM1DZT4JwgMwjjQfKm9uSBTsPmo/PGi3/ub0252yKxCJ5lesw06J2F3FAT+y9WK6kx/TWqO1uWlA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) by GV4PR04MB11894.eurprd04.prod.outlook.com (2603:10a6:150:2ed::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Thu, 3 Sep 2026 20:53:38 +0000 Received: from GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c]) by GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c%7]) with mapi id 15.21.0360.008; Thu, 3 Sep 2026 20:53:38 +0000 From: Frank.Li@oss.nxp.com Date: Thu, 03 Sep 2026 16:53:13 -0400 Subject: [PATCH v2 3/3] dmaengine: add union chan_dev for dma_chan::dev for clarity Message-Id: <20260903-dma-chan_dev-rename-v2-3-0db305b6c716@nxp.com> References: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> In-Reply-To: <20260903-dma-chan_dev-rename-v2-0-0db305b6c716@nxp.com> To: Jacky Huang , Shan-Chun Hung , Vinod Koul , Frank Li , Paul Cercueil , Eugeniy Paltsev , Andy Shevchenko , Binbin Zhou , Patrice Chotard , =?utf-8?q?Am=C3=A9lie_Delaun?= =?utf-8?q?ay?= , Maxime Coquelin , Alexandre Torgue , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Thierry Reding , Jonathan Hunter , Ludovic Desroches , Viresh Kumar , Keguang Zhang , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Kelvin Cao , Logan Gunthorpe , Laxman Dewangan , Vignesh Raghavendra Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-actions@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788468796; l=30341; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=9sa/oAlzKUnpgqIyEpl9TaONnsm/aCzrLvOCtEchlBs=; b=+CcmVCZrdN+7xpuh50oFQqkicNDG+maIQ69vYmLewjx5dssYbJPCq1Ppvek6tRNjCfqFqEu0d zH2sU9YOsYADzDCOBNIkvizPpFBBxZRCc+BtXB+bM2ZMUTa/T8aACrd X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: CY8P220CA0021.NAMP220.PROD.OUTLOOK.COM (2603:10b6:930:46::6) To GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV2PR04MB11799:EE_|GV4PR04MB11894:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f2197ef-92e0-4945-7828-08df09fd6d83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|19092799006|366016|376014|7416014|23010399003|1800799024|921020|11063799006|10067099003|56012099006|18002099003|22082099003|41080700001; X-Microsoft-Antispam-Message-Info: AL0sOQErgzvMHzq5cMnMj0Lajdc+lQrEJfpKmRaEpZyPbzbGl/s4GeY7EaKNeqedQrDvRLu/FZTqJj96DsfWuQhglQdqNw0b8Aah6PONK+TbxZi45/91bdqUsLPz68jBLq15dne8XXu5kD7rz+V0CRMcr+nJqWBhfuv5V3TBKoOPBTfH208ffdmt8H2uXGYY+PwPuy5+mi034K31f5Oiyc5PUFkuKMFQcOvsIf4pO6zSGGNl7DyDUILrbFkIOmvsxddFBiT+Fgko6zs3CxqOEsN/YNlI74jdljUCqwS/08Ez+Td56AxhQtS5mxZtNvEjpVutlP8Vrrd8iPIfL4SiWY5vE0CXZrG6nNc+r5gmFY+8IrfohEqAsnVg7/2SN8G9w9kcMf7WK2o4D9jap28YW8GNM/yzZ3sDuGJMaGaXkauFz0xpZM9qG25+LPfBGWM/ydjxvXiA+iy+5WCrgJENoRpbGqo4c5J2nwqEg+P+8GTMAesFd1ig5mPljTKd4mSFXZEkhTzlLJdt/IK4DevpVKLGpou0Ezmpv/33rVx1n9ldWl5+MU/s1Qm5xuXl5zx/fdOOsLX8xzpPW2bDql2juTrrlUHRcXzcqmx5r68z2JNDssnWtSqUC4P6Wz/jaZVcyiIM4WusqPeygH/ZBr4PRyOQhAokpYX3d1RFXLwinNtWb9F9T8tZ24Z1X1ZydP9JweIpz2PFGf8k5BSkKk7kC71Rd66alp0jK4iS4Issz4PSLMvYuwrMRbjQFL1DbtJc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR04MB11799.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(366016)(376014)(7416014)(23010399003)(1800799024)(921020)(11063799006)(10067099003)(56012099006)(18002099003)(22082099003)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?l6Ah39HCdviUyTCtstdLxDY4/Xht?= =?utf-8?q?BUyl+gvF8byitwitd3sAaLZqbxa7dRUO2qL9JFfUX9vcnop072HkqzMTjKc3vnJU6?= =?utf-8?q?XzLQEwA3ppwJD3owI3d9Msr/Tt6IC8Lxnm4eGGJsY8k7CwBr7FCQF70d/yFSydLoo?= =?utf-8?q?zndrJeDVnjSxZdJ6PrvtmatB8G8v4/0+vhyV/KDZunVASa7wTT+yrrxslfIOZsOCH?= =?utf-8?q?32or84S6RgAte5aYsp3IDJR6PBmcFkuWxzSvlk41VLy8fDaaCmTmtylGEJBGnb413?= =?utf-8?q?p8CoB5rqRvGcVVADexhWjz32K8MrxXsqHvFGUo6ZNyBXYNEw4L41hdLYtyyjfoc5T?= =?utf-8?q?FJi4hOSSknZ3UKOUOJskQcvj7iofZnGKXtPJ3H/aYRPTlW2Y0LnoBhkbWuZI1WK7C?= =?utf-8?q?HI1LL/zTvR04Mbw0/3nKtjGp/OR18oxJDA37+4oPN//Dd8EO32RdBXWhkMv6G26G7?= =?utf-8?q?NJdA3qbHq+3gh2r/Uw2buY3sI0jr/68KIUgCqKERP0Uv3vWbeBTIbVVihBIjUNyqb?= =?utf-8?q?YWkKX7f7l4tVeK6eIDz8Bg+kE3/4uKGNYNiChDRQiVWKd+sQHvJZikeDLHGR16zaA?= =?utf-8?q?8z11i9ESjbYBSwJ8G6UB1N/wZ5yZTDyOg7RbjVg7KUpHJzWDeWMIs8Ou5m9/nmcHe?= =?utf-8?q?Yhc/m3F4x/I+JW+Sn/lUdZDgllRTfhFPr0AXI9139W99m0Gd+wifJ0Hz4huLPwKBf?= =?utf-8?q?LhkfJfkVBjHn62vffs4d71WRIi4zU18b5hW3b+VcGkl6mOQ11YrqXoQIX9eu7XBEh?= =?utf-8?q?TYos2hIoGWNUFe79r6he6b0njbaYRYoWBVfuzCojz+L/BS7KHuRn+v0Z4MVFlRBgy?= =?utf-8?q?+3ai/EBFHaV07EWHm8HEJ+TH31sqVE9h0KyYNBf78xey6s+vnIpiY23bYN3CZmW1i?= =?utf-8?q?7I4q70OodqtjiA/Joqc9dx052yQbm+QaYmlxkROt6IvlmVvamyzdHYsCryofrtnte?= =?utf-8?q?jgUQJA2xO0+icYqEFqGOrPxN9uXr5Ea0t8hiGUYQL6Xx+UEpTbCpVQ07jtrk2Rfpl?= =?utf-8?q?ctk6oMjNOiOJGR1cNzMXWI1DXy1/07NRbJL0ByccVPKQFV918P8OXkrXpVmbvLutC?= =?utf-8?q?vIlEF3DT0yNK1uPdD7N/XCMKFhVzxz2mdXCEX31/Z9qFIPEU+oW2i/BRlkT3hcPx6?= =?utf-8?q?v18dvfJ1aSUNG8dUuBzvkCuhVapQX81tIEnuJ5XqJiw5Mw6pzSwFUgTBJMqnjZ7fG?= =?utf-8?q?kVkwHvajf/Ry99LswF/6AkWnhtwOM8+yperY6fYpDBCLAVRo2a++xk0iqOIxUE7tG?= =?utf-8?q?LwdyEs8sQasoKsAUM0My5QMWUdHm1U+nVcsBv/lZFNmnbxv2Lxhfm9LhAvkRsiZ6g?= =?utf-8?q?Le2YCWHBK4RFCz7w86gigMxrBRwW/7+rLGQQjPpcNv4HdCCbJMYFy7LiCpYhU0dBU?= =?utf-8?q?FdeRNFxW/W0x67eifmlXg5r8aFy8aYDhF3UuAVuoxjab/momN6OyMo8Glw1XAGx2H?= =?utf-8?q?/W9LKLVNeCkjiZda/rxfSDKRB7TzLeEHEW1Woxxmvcl9udAqZyG0+KA4YZ7TJUu8S?= =?utf-8?q?QVW2N5L5ypb7hdAXkszwFqQIFT5YdHpgCtt98TDMEzCpG2fJVu6nilaxeA5U6gx9s?= =?utf-8?q?cCDV2IYXGWUY/uZo1IStaR6jKqfmMwta59fyI/4iOvzZUljy+7uYi1CVV3ECU6FEL?= =?utf-8?q?MX4H2PifqyPWoScE+0G4b8G3y9PNBubPrsNl52TmcrRBfK8ZP14MrGDOXwZJalEzS?= =?utf-8?q?j6XG3vbGF?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f2197ef-92e0-4945-7828-08df09fd6d83 X-MS-Exchange-CrossTenant-AuthSource: GV2PR04MB11799.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2026 20:53:38.1412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Xr4+t2nu3xs6GPOZVUDkG8tm5echsI+p9ZxiMPODHBRnLezKX90tHcWRdZXGoAfWx/U+6Cql5iIFyofoiF8Ek+LSi9V/z+H5lTw67TXNtgdxTLTRiPrgCblSDL8M3+6m X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV4PR04MB11894 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Frank Li The current dma_chan structure contains both "device" and "dev". So chan->device->dev refers to the DMA engine device. chan->dev->device refers to the per-channel device instance. Their similar naming makes the distinction unclear and increases reader confusion. Add union dma_chan::chan_dev to make its purpose explicit and clearly identify it as the per-channel device. After all user switch to chan_dev, union and dma_chan::dev will be removed. Update the kernel-doc accordingly. Besides its sysfs usage, the per-channel device is also used by some DMA engine drivers for IOMMU mapping and therefore deserves a more accurate description. No functional change intended. Reviewed-by: Logan Gunthorpe Signed-off-by: Frank Li --- there are other user use it outside drivers/dma/ directory. --- drivers/dma/at_hdmac.c | 2 +- drivers/dma/at_xdmac.c | 2 +- drivers/dma/dma-jz4780.c | 8 ++--- drivers/dma/dmaengine.c | 34 +++++++++--------- drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 4 +-- drivers/dma/dw/core.c | 2 +- drivers/dma/ep93xx_dma.c | 2 +- drivers/dma/idma64.c | 2 +- drivers/dma/loongson/loongson1-apb-dma.c | 2 +- drivers/dma/loongson/loongson2-apb-cmc-dma.c | 2 +- drivers/dma/loongson/loongson2-apb-dma.c | 2 +- drivers/dma/nbpfaxi.c | 2 +- drivers/dma/owl-dma.c | 2 +- drivers/dma/pch_dma.c | 2 +- drivers/dma/pxa_dma.c | 52 ++++++++++++++-------------- drivers/dma/stm32/stm32-dma.c | 2 +- drivers/dma/stm32/stm32-dma3.c | 2 +- drivers/dma/stm32/stm32-mdma.c | 2 +- drivers/dma/sun6i-dma.c | 2 +- drivers/dma/switchtec_dma.c | 14 ++++---- drivers/dma/tegra186-gpc-dma.c | 4 +-- drivers/dma/tegra20-apb-dma.c | 2 +- drivers/dma/ti/k3-udma.c | 6 ++-- drivers/dma/timb_dma.c | 2 +- include/linux/dmaengine.h | 18 +++++++--- 25 files changed, 91 insertions(+), 83 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index f4d0c72787d13..5df429002950b 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -383,7 +383,7 @@ static inline struct at_dma *to_at_dma(struct dma_device *ddev) static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } #if defined(VERBOSE_DEBUG) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 901971e8bae69..30ec996845ce7 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -326,7 +326,7 @@ static inline struct at_xdmac_chan *to_at_xdmac_chan(struct dma_chan *dchan) static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline struct at_xdmac *to_at_xdmac(struct dma_device *ddev) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 194649811d02b..c48a46b2bbbf2 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -687,12 +687,12 @@ static bool jz4780_dma_chan_irq(struct jz4780_dma_dev *jzdma, jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 0); if (dcs & JZ_DMA_DCS_AR) { - dev_warn(&jzchan->vchan.chan.dev->device, + dev_warn(&jzchan->vchan.chan.chan_dev->device, "address error (DCS=0x%x)\n", dcs); } if (dcs & JZ_DMA_DCS_HLT) { - dev_warn(&jzchan->vchan.chan.dev->device, + dev_warn(&jzchan->vchan.chan.chan_dev->device, "channel halt (DCS=0x%x)\n", dcs); } @@ -721,7 +721,7 @@ static bool jz4780_dma_chan_irq(struct jz4780_dma_dev *jzdma, } } } else { - dev_err(&jzchan->vchan.chan.dev->device, + dev_err(&jzchan->vchan.chan.chan_dev->device, "channel IRQ with no active transfer\n"); } @@ -765,7 +765,7 @@ static int jz4780_dma_alloc_chan_resources(struct dma_chan *chan) JZ_DMA_DESC_BLOCK_SIZE, PAGE_SIZE, 0); if (!jzchan->desc_pool) { - dev_err(&chan->dev->device, + dev_err(&chan->chan_dev->device, "failed to allocate descriptor pool\n"); return -ENOMEM; } diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 6ffd8bd82154a..c00641366c4dc 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -868,10 +868,10 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) return chan; chan->slave = dev; - if (sysfs_create_link(&chan->dev->device.kobj, &dev->kobj, + if (sysfs_create_link(&chan->chan_dev->device.kobj, &dev->kobj, DMA_SLAVE_NAME)) dev_warn(dev, "Cannot create DMA %s symlink\n", DMA_SLAVE_NAME); - if (sysfs_create_link(&dev->kobj, &chan->dev->device.kobj, chan->name)) + if (sysfs_create_link(&dev->kobj, &chan->chan_dev->device.kobj, chan->name)) dev_warn(dev, "Cannot create DMA %s symlink\n", chan->name); return chan; @@ -917,7 +917,7 @@ void dma_release_channel(struct dma_chan *chan) dma_chan_put(chan); if (chan->slave) { - sysfs_remove_link(&chan->dev->device.kobj, DMA_SLAVE_NAME); + sysfs_remove_link(&chan->chan_dev->device.kobj, DMA_SLAVE_NAME); sysfs_remove_link(&chan->slave->kobj, chan->name); kfree(chan->name); chan->name = NULL; @@ -1083,8 +1083,8 @@ static int __dma_async_device_channel_register(struct dma_device *device, chan->local = alloc_percpu(typeof(*chan->local)); if (!chan->local) return -ENOMEM; - chan->dev = kzalloc_obj(*chan->dev); - if (!chan->dev) { + chan->chan_dev = kzalloc_obj(*chan->chan_dev); + if (!chan->chan_dev) { rc = -ENOMEM; goto err_free_local; } @@ -1101,17 +1101,17 @@ static int __dma_async_device_channel_register(struct dma_device *device, goto err_free_dev; } - chan->dev->device.class = &dma_devclass; - chan->dev->device.parent = device->dev; - chan->dev->chan = chan; - chan->dev->dev_id = device->dev_id; + chan->chan_dev->device.class = &dma_devclass; + chan->chan_dev->device.parent = device->dev; + chan->chan_dev->chan = chan; + chan->chan_dev->dev_id = device->dev_id; spin_lock_init(&chan->lock); if (!name) - dev_set_name(&chan->dev->device, "dma%dchan%d", device->dev_id, chan->chan_id); + dev_set_name(&chan->chan_dev->device, "dma%dchan%d", device->dev_id, chan->chan_id); else - dev_set_name(&chan->dev->device, "%s", name); - rc = device_register(&chan->dev->device); + dev_set_name(&chan->chan_dev->device, "%s", name); + rc = device_register(&chan->chan_dev->device); if (rc) goto err_out_ida; chan->client_count = 0; @@ -1122,7 +1122,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, err_out_ida: ida_free(&device->chan_ida, chan->chan_id); err_free_dev: - kfree(chan->dev); + kfree(chan->chan_dev); err_free_local: free_percpu(chan->local); chan->local = NULL; @@ -1155,10 +1155,10 @@ static void __dma_async_device_channel_unregister(struct dma_device *device, __func__, chan->client_count); mutex_lock(&dma_list_mutex); device->chancnt--; - chan->dev->chan = NULL; + chan->chan_dev->chan = NULL; mutex_unlock(&dma_list_mutex); ida_free(&device->chan_ida, chan->chan_id); - device_unregister(&chan->dev->device); + device_unregister(&chan->chan_dev->device); free_percpu(chan->local); } @@ -1290,9 +1290,9 @@ int dma_async_device_register(struct dma_device *device) if (chan->local == NULL) continue; mutex_lock(&dma_list_mutex); - chan->dev->chan = NULL; + chan->chan_dev->chan = NULL; mutex_unlock(&dma_list_mutex); - device_unregister(&chan->dev->device); + device_unregister(&chan->chan_dev->device); free_percpu(chan->local); } return rc; diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h index 039316c42f059..05524ec96bcab 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h @@ -120,12 +120,12 @@ struct axi_dma_chan_config { static inline struct device *dchan2dev(struct dma_chan *dchan) { - return &dchan->dev->device; + return &dchan->chan_dev->device; } static inline struct device *chan2dev(struct axi_dma_chan *chan) { - return &chan->vc.chan.dev->device; + return &chan->vc.chan.chan_dev->device; } static inline struct axi_dma_desc *vd_to_axi_desc(struct virt_dma_desc *vd) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index dd75f97a33b3d..d5618c128121f 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -43,7 +43,7 @@ static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static struct dw_desc *dwc_first_active(struct dw_dma_chan *dwc) diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 311e55a97ba9f..977ab12c793e9 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -252,7 +252,7 @@ struct ep93xx_edma_data { static inline struct device *chan2dev(struct ep93xx_dma_chan *edmac) { - return &edmac->chan.dev->device; + return &edmac->chan.chan_dev->device; } static struct ep93xx_dma_chan *to_ep93xx_dma_chan(struct dma_chan *chan) diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 6399fd5408be2..6fdc0d50964ad 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -27,7 +27,7 @@ static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } /* ---------------------------------------------------------------------- */ diff --git a/drivers/dma/loongson/loongson1-apb-dma.c b/drivers/dma/loongson/loongson1-apb-dma.c index 89786cbd20ab5..03c8081e4b9a9 100644 --- a/drivers/dma/loongson/loongson1-apb-dma.c +++ b/drivers/dma/loongson/loongson1-apb-dma.c @@ -91,7 +91,7 @@ static irqreturn_t ls1x_dma_irq_handler(int irq, void *data); static inline struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline int ls1x_dma_query(struct ls1x_dma_chan *chan, diff --git a/drivers/dma/loongson/loongson2-apb-cmc-dma.c b/drivers/dma/loongson/loongson2-apb-cmc-dma.c index 2f1c8c4fd0654..69914778ead9e 100644 --- a/drivers/dma/loongson/loongson2-apb-cmc-dma.c +++ b/drivers/dma/loongson/loongson2-apb-cmc-dma.c @@ -136,7 +136,7 @@ static struct loongson2_cmc_dma_desc *to_lmdma_desc(struct virt_dma_desc *vdesc) static struct device *chan2dev(struct loongson2_cmc_dma_chan *lchan) { - return &lchan->vchan.chan.dev->device; + return &lchan->vchan.chan.chan_dev->device; } static u32 loongson2_cmc_dma_read(struct loongson2_cmc_dma_dev *lddev, u32 reg, u32 id) diff --git a/drivers/dma/loongson/loongson2-apb-dma.c b/drivers/dma/loongson/loongson2-apb-dma.c index 7c3d7c3273955..94f4364fbfb56 100644 --- a/drivers/dma/loongson/loongson2-apb-dma.c +++ b/drivers/dma/loongson/loongson2-apb-dma.c @@ -163,7 +163,7 @@ static inline struct ls2x_dma_priv *to_ldma_priv(struct dma_device *ddev) static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static void ls2x_dma_desc_free(struct virt_dma_desc *vdesc) diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 05d7321629cc8..4dd87cafc5e0a 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -1202,7 +1202,7 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) nbpf_status_ack(chan); - dev_dbg(&chan->dma_chan.dev->device, "%s()\n", __func__); + dev_dbg(&chan->dma_chan.chan_dev->device, "%s()\n", __func__); spin_lock(&chan->lock); desc = chan->running; diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c index 7c80572fc71d1..ab7531a3a89c9 100644 --- a/drivers/dma/owl-dma.c +++ b/drivers/dma/owl-dma.c @@ -294,7 +294,7 @@ static inline struct owl_dma *to_owl_dma(struct dma_device *dd) static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline struct owl_dma_vchan *to_owl_vchan(struct dma_chan *chan) diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index bf805f1024f64..69d60b587c2bb 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -152,7 +152,7 @@ static inline struct pch_dma *to_pd(struct dma_device *ddev) static inline struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index fa2ee0b3e09f8..5398b47fec370 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -149,7 +149,7 @@ struct pxad_device { ({ \ u32 _v; \ _v = readl_relaxed((phy)->base + _reg((phy)->idx)); \ - dev_vdbg(&phy->vchan->vc.chan.dev->device, \ + dev_vdbg(&phy->vchan->vc.chan.chan_dev->device, \ "%s(): readl(%s): 0x%08x\n", __func__, #_reg, \ _v); \ _v; \ @@ -157,14 +157,14 @@ struct pxad_device { #define phy_writel(phy, val, _reg) \ do { \ writel((val), (phy)->base + _reg((phy)->idx)); \ - dev_vdbg(&phy->vchan->vc.chan.dev->device, \ + dev_vdbg(&phy->vchan->vc.chan.chan_dev->device, \ "%s(): writel(0x%08x, %s)\n", \ __func__, (u32)(val), #_reg); \ } while (0) #define phy_writel_relaxed(phy, val, _reg) \ do { \ writel_relaxed((val), (phy)->base + _reg((phy)->idx)); \ - dev_vdbg(&phy->vchan->vc.chan.dev->device, \ + dev_vdbg(&phy->vchan->vc.chan.chan_dev->device, \ "%s(): writel_relaxed(0x%08x, %s)\n", \ __func__, (u32)(val), #_reg); \ } while (0) @@ -396,7 +396,7 @@ static struct pxad_phy *lookup_phy(struct pxad_chan *pchan) out_unlock: spin_unlock_irqrestore(&pdev->phy_lock, flags); - dev_dbg(&pchan->vc.chan.dev->device, + dev_dbg(&pchan->vc.chan.chan_dev->device, "%s(): phy=%p(%d)\n", __func__, found, found ? found->idx : -1); @@ -409,7 +409,7 @@ static void pxad_free_phy(struct pxad_chan *chan) unsigned long flags; u32 reg; - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): freeing\n", __func__); if (!chan->phy) return; @@ -454,7 +454,7 @@ static void phy_enable(struct pxad_phy *phy, bool misaligned) if (!phy->vchan) return; - dev_dbg(&phy->vchan->vc.chan.dev->device, + dev_dbg(&phy->vchan->vc.chan.chan_dev->device, "%s(); phy=%p(%d) misaligned=%d\n", __func__, phy, phy->idx, misaligned); @@ -483,7 +483,7 @@ static void phy_disable(struct pxad_phy *phy) return; dcsr = phy_readl_relaxed(phy, DCSR); - dev_dbg(&phy->vchan->vc.chan.dev->device, + dev_dbg(&phy->vchan->vc.chan.chan_dev->device, "%s(): phy=%p(%d)\n", __func__, phy, phy->idx); phy_writel(phy, dcsr & ~PXA_DCSR_RUN & ~PXA_DCSR_STOPIRQEN, DCSR); } @@ -491,12 +491,12 @@ static void phy_disable(struct pxad_phy *phy) static void pxad_launch_chan(struct pxad_chan *chan, struct pxad_desc_sw *desc) { - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): desc=%p\n", __func__, desc); if (!chan->phy) { chan->phy = lookup_phy(chan); if (!chan->phy) { - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): no free dma channel\n", __func__); return; } @@ -592,7 +592,7 @@ static unsigned int clear_chan_irq(struct pxad_phy *phy) dcsr = phy_readl_relaxed(phy, DCSR); phy_writel(phy, dcsr, DCSR); if ((dcsr & PXA_DCSR_BUSERR) && (phy->vchan)) - dev_warn(&phy->vchan->vc.chan.dev->device, + dev_warn(&phy->vchan->vc.chan.chan_dev->device, "%s(chan=%p): PXA_DCSR_BUSERR\n", __func__, &phy->vchan); @@ -617,7 +617,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id) spin_lock(&chan->vc.lock); list_for_each_entry_safe(vd, tmp, &chan->vc.desc_issued, node) { vd_completed = is_desc_completed(vd); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): checking txd %p[%x]: completed=%d dcsr=0x%x\n", __func__, vd, vd->tx.cookie, vd_completed, dcsr); @@ -640,7 +640,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id) } if (!chan->bus_error && dcsr & PXA_DCSR_STOPSTATE) { - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): channel stopped, submitted_empty=%d issued_empty=%d", __func__, list_empty(&chan->vc.desc_submitted), @@ -694,7 +694,7 @@ static int pxad_alloc_chan_resources(struct dma_chan *dchan) __alignof__(struct pxad_desc_hw), 0); if (!chan->desc_pool) { - dev_err(&chan->vc.chan.dev->device, + dev_err(&chan->vc.chan.chan_dev->device, "%s(): unable to allocate descriptor pool\n", __func__); return -ENOMEM; @@ -749,7 +749,7 @@ pxad_alloc_desc(struct pxad_chan *chan, unsigned int nb_hw_desc) for (i = 0; i < nb_hw_desc; i++) { desc = dma_pool_alloc(sw_desc->desc_pool, GFP_NOWAIT, &dma); if (!desc) { - dev_err(&chan->vc.chan.dev->device, + dev_err(&chan->vc.chan.chan_dev->device, "%s(): Couldn't allocate the %dth hw_desc from dma_pool %p\n", __func__, i, sw_desc->desc_pool); goto err; @@ -786,7 +786,7 @@ static dma_cookie_t pxad_tx_submit(struct dma_async_tx_descriptor *tx) if (list_empty(&vc->desc_submitted) && pxad_try_hotchain(vc, vd)) { list_move_tail(&vd->node, &vc->desc_issued); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): txd %p[%x]: submitted (hot linked)\n", __func__, vd, cookie); goto out; @@ -809,7 +809,7 @@ static dma_cookie_t pxad_tx_submit(struct dma_async_tx_descriptor *tx) else vd_chained = NULL; } - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): txd %p[%x]: submitted (%s linked)\n", __func__, vd, cookie, vd_chained ? "cold" : "not"); list_move_tail(&vd->node, &vc->desc_submitted); @@ -832,7 +832,7 @@ static void pxad_issue_pending(struct dma_chan *dchan) vd_first = list_first_entry(&chan->vc.desc_submitted, struct virt_dma_desc, node); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): txd %p[%x]", __func__, vd_first, vd_first->tx.cookie); vchan_issue_pending(&chan->vc); @@ -852,7 +852,7 @@ pxad_tx_prep(struct virt_dma_chan *vc, struct virt_dma_desc *vd, INIT_LIST_HEAD(&vd->node); tx = vchan_tx_prep(vc, vd, tx_flags); tx->tx_submit = pxad_tx_submit; - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): vc=%p txd=%p[%x] flags=0x%lx\n", __func__, vc, vd, vd->tx.cookie, tx_flags); @@ -891,7 +891,7 @@ static void pxad_get_config(struct pxad_chan *chan, *dcmd |= PXA_DCMD_BURST32 | PXA_DCMD_INCTRGADDR | PXA_DCMD_INCSRCADDR; - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): dev_addr=0x%x maxburst=%d width=%d dir=%d\n", __func__, dev_addr, maxburst, width, dir); @@ -925,7 +925,7 @@ pxad_prep_memcpy(struct dma_chan *dchan, if (!dchan || !len) return NULL; - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): dma_dst=0x%lx dma_src=0x%lx len=%zu flags=%lx\n", __func__, (unsigned long)dma_dst, (unsigned long)dma_src, len, flags); @@ -974,7 +974,7 @@ pxad_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, return NULL; pxad_get_config(chan, dir, &dcmd, &dsadr, &dtadr); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): dir=%d flags=%lx\n", __func__, dir, flags); nb_desc = sg_nents_for_dma(sgl, sg_len, PDMA_MAX_DESC_BYTES); @@ -1021,7 +1021,7 @@ pxad_prep_dma_cyclic(struct dma_chan *dchan, if (!dchan || !len || !period_len) return NULL; if ((dir != DMA_DEV_TO_MEM) && (dir != DMA_MEM_TO_DEV)) { - dev_err(&chan->vc.chan.dev->device, + dev_err(&chan->vc.chan.chan_dev->device, "Unsupported direction for cyclic DMA\n"); return NULL; } @@ -1032,7 +1032,7 @@ pxad_prep_dma_cyclic(struct dma_chan *dchan, pxad_get_config(chan, dir, &dcmd, &dsadr, &dtadr); dcmd |= PXA_DCMD_ENDIRQEN | (PXA_DCMD_LENGTH & period_len); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): buf_addr=0x%lx len=%zu period=%zu dir=%d flags=%lx\n", __func__, (unsigned long)buf_addr, len, period_len, dir, flags); @@ -1080,14 +1080,14 @@ static int pxad_terminate_all(struct dma_chan *dchan) struct pxad_phy *phy; LIST_HEAD(head); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): vchan %p: terminate all\n", __func__, &chan->vc); spin_lock_irqsave(&chan->vc.lock, flags); vchan_get_all_descriptors(&chan->vc, &head); list_for_each_entry(vd, &head, node) { - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): cancelling txd %p[%x] (completed=%d)", __func__, vd, vd->tx.cookie, is_desc_completed(vd)); } @@ -1177,7 +1177,7 @@ static unsigned int pxad_residue(struct pxad_chan *chan, out: spin_unlock_irqrestore(&chan->vc.lock, flags); - dev_dbg(&chan->vc.chan.dev->device, + dev_dbg(&chan->vc.chan.chan_dev->device, "%s(): txd %p[%x] sw_desc=%p: %d\n", __func__, vd, cookie, sw_desc, residue); return residue; diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c index 3e8151e2ad75a..5908782e66705 100644 --- a/drivers/dma/stm32/stm32-dma.c +++ b/drivers/dma/stm32/stm32-dma.c @@ -250,7 +250,7 @@ static struct stm32_dma_desc *to_stm32_dma_desc(struct virt_dma_desc *vdesc) static struct device *chan2dev(struct stm32_dma_chan *chan) { - return &chan->vchan.chan.dev->device; + return &chan->vchan.chan.chan_dev->device; } static u32 stm32_dma_read(struct stm32_dma_device *dmadev, u32 reg) diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c index 6ee7a1435efb6..78358d3734493 100644 --- a/drivers/dma/stm32/stm32-dma3.c +++ b/drivers/dma/stm32/stm32-dma3.c @@ -330,7 +330,7 @@ static inline struct stm32_dma3_swdesc *to_stm32_dma3_swdesc(struct virt_dma_des static struct device *chan2dev(struct stm32_dma3_chan *chan) { - return &chan->vchan.chan.dev->device; + return &chan->vchan.chan.chan_dev->device; } static struct device *ddata2dev(struct stm32_dma3_ddata *ddata) diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c index c274638e919c2..a7ab77e4ebbcb 100644 --- a/drivers/dma/stm32/stm32-mdma.c +++ b/drivers/dma/stm32/stm32-mdma.c @@ -278,7 +278,7 @@ static struct stm32_mdma_desc *to_stm32_mdma_desc(struct virt_dma_desc *vdesc) static struct device *chan2dev(struct stm32_mdma_chan *chan) { - return &chan->vchan.chan.dev->device; + return &chan->vchan.chan.chan_dev->device; } static struct device *mdma2dev(struct stm32_mdma_device *mdma_dev) diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index c248c2dec956a..3d5ca27b6e9d2 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -215,7 +215,7 @@ struct sun6i_dma_dev { static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline struct sun6i_dma_dev *to_sun6i_dma_dev(struct dma_device *d) diff --git a/drivers/dma/switchtec_dma.c b/drivers/dma/switchtec_dma.c index c133535d37656..ebb734f807a3b 100644 --- a/drivers/dma/switchtec_dma.c +++ b/drivers/dma/switchtec_dma.c @@ -406,7 +406,7 @@ static int disable_channel(struct switchtec_dma_chan *swdma_chan) static void switchtec_dma_cleanup_completed(struct switchtec_dma_chan *swdma_chan) { - struct device *chan_dev = &swdma_chan->dma_chan.dev->device; + struct device *chan_dev = &swdma_chan->dma_chan.chan_dev->device; struct switchtec_dma_desc *desc; struct switchtec_dma_hw_ce *ce; struct dmaengine_result res; @@ -851,7 +851,7 @@ static irqreturn_t switchtec_dma_chan_status_isr(int irq, void *dma) list_for_each_entry(chan, &dma_dev->channels, device_node) { swdma_chan = container_of(chan, struct switchtec_dma_chan, dma_chan); - chan_dev = &swdma_chan->dma_chan.dev->device; + chan_dev = &swdma_chan->dma_chan.chan_dev->device; chan_hw = swdma_chan->mmio_chan_hw; rcu_read_lock(); @@ -1009,19 +1009,19 @@ static int switchtec_dma_alloc_chan_resources(struct dma_chan *chan) perf_cfg = readl(&swdma_chan->mmio_chan_fw->perf_cfg); rcu_read_unlock(); - dev_dbg(&chan->dev->device, "Burst Size: 0x%x\n", + dev_dbg(&chan->chan_dev->device, "Burst Size: 0x%x\n", FIELD_GET(PERF_BURST_SIZE_MASK, perf_cfg)); - dev_dbg(&chan->dev->device, "Burst Scale: 0x%x\n", + dev_dbg(&chan->chan_dev->device, "Burst Scale: 0x%x\n", FIELD_GET(PERF_BURST_SCALE_MASK, perf_cfg)); - dev_dbg(&chan->dev->device, "Interval: 0x%x\n", + dev_dbg(&chan->chan_dev->device, "Interval: 0x%x\n", FIELD_GET(PERF_INTERVAL_MASK, perf_cfg)); - dev_dbg(&chan->dev->device, "Arb Weight: 0x%x\n", + dev_dbg(&chan->chan_dev->device, "Arb Weight: 0x%x\n", FIELD_GET(PERF_ARB_WEIGHT_MASK, perf_cfg)); - dev_dbg(&chan->dev->device, "MRRS: 0x%x\n", + dev_dbg(&chan->chan_dev->device, "MRRS: 0x%x\n", FIELD_GET(PERF_MRRS_MASK, perf_cfg)); return SWITCHTEC_DMA_SQ_SIZE; diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index 64cedef1050ae..e36111e8a76dc 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -1537,7 +1537,7 @@ static int tegra_dma_probe(struct platform_device *pdev) * the channels available and registered for the DMA device are used. */ list_for_each_entry(chan, &tdma->dma_dev.channels, device_node) { - chdev = &chan->dev->device; + chdev = &chan->chan_dev->device; tdc = to_tegra_dma_chan(chan); if (use_iommu_map) { @@ -1554,7 +1554,7 @@ static int tegra_dma_probe(struct platform_device *pdev) return dev_err_probe(chdev, -EINVAL, "Failed to get stream ID for channel %d\n", tdc->id); - chan->dev->chan_dma_dev = true; + chan->chan_dev->chan_dma_dev = true; } /* program stream-id for this channel */ diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 640b8a218c9ad..33811e7ee6552 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -256,7 +256,7 @@ txd_to_tegra_dma_desc(struct dma_async_tx_descriptor *td) static inline struct device *tdc2dev(struct tegra_dma_channel *tdc) { - return &tdc->dma_chan.dev->device; + return &tdc->dma_chan.chan_dev->device; } static dma_cookie_t tegra_dma_tx_submit(struct dma_async_tx_descriptor *tx); diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index fb21e0df5ab7b..4fa6e81ff5a86 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -422,16 +422,16 @@ static int navss_psil_unpair(struct udma_dev *ud, u32 src_thread, static void k3_configure_chan_coherency(struct dma_chan *chan, u32 asel) { - struct device *chan_dev = &chan->dev->device; + struct device *chan_dev = &chan->chan_dev->device; if (asel == 0) { /* No special handling for the channel */ - chan->dev->chan_dma_dev = false; + chan->chan_dev->chan_dma_dev = false; dev_clear_dma_coherent(chan_dev); chan_dev->dma_parms = NULL; } else if (asel == 14 || asel == 15) { - chan->dev->chan_dma_dev = true; + chan->chan_dev->chan_dma_dev = true; dev_set_dma_coherent(chan_dev); dma_coerce_mask_and_coherent(chan_dev, DMA_BIT_MASK(48)); diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index 4fc5119854ec1..f414e41d90013 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -93,7 +93,7 @@ struct timb_dma { static struct device *chan2dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static struct device *chan2dmadev(struct dma_chan *chan) { diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index fe33a20abc614..0fcec3f21390b 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -325,7 +325,8 @@ struct dma_router { * @lock: protect between config and prepare transfer when driver have not * implemented callback device_prep_config_sg(). * @chan_id: channel ID for sysfs - * @dev: class device for sysfs + * @chan_dev: class channel device for sysfs, some device use it for per-channel + * iommu mapping. * @name: backlink name for sysfs * @dbg_client_name: slave name for debugfs in format: * dev_name(requester's dev):channel name, for example: "2b00000.mcasp:tx" @@ -351,7 +352,14 @@ struct dma_chan { /* sysfs */ int chan_id; - struct dma_chan_dev *dev; + union { + struct dma_chan_dev *chan_dev; + /* + * please use chan_dev, dev will be removed after all user + switch to chan_dev + */ + struct dma_chan_dev *dev; + }; const char *name; #ifdef CONFIG_DEBUG_FS char *dbg_client_name; @@ -532,7 +540,7 @@ struct dma_slave_caps { static inline const char *dma_chan_name(struct dma_chan *chan) { - return dev_name(&chan->dev->device); + return dev_name(&chan->chan_dev->device); } /** @@ -1805,8 +1813,8 @@ dmaengine_get_direction_text(enum dma_transfer_direction dir) static inline struct device *dmaengine_get_dma_device(struct dma_chan *chan) { - if (chan->dev->chan_dma_dev) - return &chan->dev->device; + if (chan->chan_dev->chan_dma_dev) + return &chan->chan_dev->device; return chan->device->dev; }