From nobody Sat Jul 25 07:01:44 2026 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49D964477EB for ; Fri, 24 Jul 2026 22:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784933846; cv=none; b=DyeEPs4mvK16/hMlSo3y5CaRYDBJc241qGHn166ehuFxMrY3fX8joO0v/NzHpbsp+EqS1XmHmzv03GImc28W/F2nARNgkmwbb4RtZqsLij5IBSXNmbWLv/eXGWVxTVCQ45Cne/FOfqCtb3HWnEXCq3JgEQAyH6yrXi4VzQHSr8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784933846; c=relaxed/simple; bh=TElq1Kki924a5CaW1J7lYnAjY2sRtqH1W1lXcKZ5DuU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d200gPlUdMi2e7+XWhknEauFgrUXPBIq86QoUm/VLBMCdihFGyO2DQU4FGJ2d72UFccIqy3BxICCMuXncY4Rnokkao7DLxKwCK95mxllRX6PSckWZDha/EcmtQe1w8/4MA2Y/PaGRNnH5qrUU9r8uDyxi2v6hj2+jS1V5DzxCJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=o8qXsI1f; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o8qXsI1f" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-383b4a3755fso877057a91.3 for ; Fri, 24 Jul 2026 15:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784933843; x=1785538643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=DudDQKCoIhab8frMhgA6W9h7XpPyKDOhbOMYUMP2BNI=; b=o8qXsI1fWXVnXRhKbdgWC1utsOEYyYZvSHJ+jB3XWNMepl3LqxDnemku+XWnVCVhgn vJ77HeXV/fe7qdOgMj85yuFaQ3kDXBBELzhQ7MwCn+7ZEE6InLCVidFBIqYWhcaFBG9M fb7JdntUptBHn2rOFeGYpPiXX/P3w7omusBEkK4DW6otM4P8gYmipQq5N1ZWqctbAo9w FNykvmXRmiW7GHB7Vo9mhl3B0tvuSIwXb6JkTS0Oq29VxnhktluFQ0IEYIlFYq7SklAS m547CMNmcrCciYOIoGtuFEaiddScIa+qKZaGBM2VCzaaveKFRoy4ITeTSdtgP9Nyu6Dp YZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784933843; x=1785538643; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DudDQKCoIhab8frMhgA6W9h7XpPyKDOhbOMYUMP2BNI=; b=Jy0shfrZahtZ1UYBVwA+1Wmfkf6ik+z0nae60akEL2ZW/yWeeV5t91jAlOyFlr9UCw 51QJI6gZzg3dVkE3ZfPTomlXo29bseftMU3LqZxCPUFSIyZD2SRSv87KkU01AjCd0C1y pwkqdhjpqnKkuXg68Ds68Oll9RZoR6I5FvtTrhSEwhKyLI+onMj1I6jBIlFLpYar5wGp 5+a4DB/tdSBM7Tt8+HavUq3VwWNy6p6SJ3TPXzqZwRl0XWc4QOC9Z4uqkLYWvxOGU2CT 6WXc59xU/pmtN4ifHtV0p4Z/hOccS8OTsDZe/8vSmgRzyBefpqTIeh2DQzJdJcaPFdE6 8Akw== X-Forwarded-Encrypted: i=1; AHgh+RrSxHKzYNDkR0IyH1GwFi0OoFwMK2YDN4j8dobRcW2/Eu+D2iYrMKKhwkN3OUl0qzz3An1kF7CwOlI3c2k=@vger.kernel.org X-Gm-Message-State: AOJu0YxVAfK+RIWWbMJpNr+h4W5LIaUO7lPlT0TpDfpm0ZnDtXNbupQa lU8akqSrn6Jd24l4gyl0RnkssdL5/F28YjFVgG/PYLFwz0y0tTfSFhNQ X-Gm-Gg: AR+sD12IqMz5IYpfns2fwA1pJiYp7bMv62o80xqJgnBBySMfsspb1PGq41+IDKW4JdU m/fp45ZX5YaoUi2Q7mj65KN9cgUpok1QS1ZiSU1zqrlwjjAgPg45EyojooY4EGj011fBG6Ax7gu od4G/1xFJQJMrfWnYRs+mUfskf8SUJ/9jsB+870B8WofQ5sc5GH/cNWijbvTbW2X3jFwIzoyt9o tNOKCTMgEjou23id5GzD1q8O0rODKRcptf7r8BQePYPi/aoHa5g48owObGlLWbF5+t+fjOXhCX8 8usaLYxSG+UDyJwtWc0uJ2+LYftKtpqM+lRp6SBPjrUVgD4LJYEB9v+dGZWec6UaW9rB/ACrOqF Lqo2FLu1efPlBS8yMGJukrenvxxgx5oYcf61yxvUoyi7qYdAB690+cCkzSOIGbWu6lYTXr5tHxc 6mqWzsa9NMC3WOknSxZU1dpFUxfbmNSmv3GftA+vH/UZfH6LxkUknx2hdR87hTaI26zPG2U3rBk 5GtKCNBA9s/lJRvtmJlg2Kdn+CgjzFbiSTVCLiOLPvGCCzKZ4Pgc3XtZGk59RrPfA== X-Received: by 2002:a17:90b:1f85:b0:387:e0db:3fae with SMTP id 98e67ed59e1d1-38f298bc8e2mr342043a91.39.1784933842946; Fri, 24 Jul 2026 15:57:22 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e35]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f292d1d75sm119239a91.5.2026.07.24.15.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 15:57:22 -0700 (PDT) From: Rosen Penev To: dmaengine@vger.kernel.org Cc: Ludovic Desroches , Vinod Koul , Frank Li , linux-arm-kernel@lists.infradead.org (moderated list:MICROCHIP AT91 DMA DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCHv2] dmaengine: at_hdmac: use more devm in _probe Date: Fri, 24 Jul 2026 15:57:20 -0700 Message-ID: <20260724225720.43410-1-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 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" As devm is already used in _probe, complete the conversion so that everything unwinds in proper order. Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev --- v2: remove list_del drivers/dma/at_hdmac.c | 50 ++++++++++-------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index e5b30a57c477..f16cf29ca548 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1980,40 +1980,34 @@ static int __init at_dma_probe(struct platform_devi= ce *pdev) atdma->dma_device.cap_mask =3D plat_dat->cap_mask; atdma->all_chan_mask =3D (1 << plat_dat->nr_channels) - 1; =20 - atdma->clk =3D devm_clk_get(&pdev->dev, "dma_clk"); + atdma->clk =3D devm_clk_get_enabled(&pdev->dev, "dma_clk"); if (IS_ERR(atdma->clk)) return PTR_ERR(atdma->clk); =20 - err =3D clk_prepare_enable(atdma->clk); - if (err) - return err; - /* force dma off, just in case */ at_dma_off(atdma); =20 - err =3D request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma); + err =3D devm_request_irq(&pdev->dev, irq, at_dma_interrupt, 0, "at_hdmac"= , atdma); if (err) - goto err_irq; + return err; =20 platform_set_drvdata(pdev, atdma); =20 /* create a pool of consistent memory blocks for hardware descriptors */ - atdma->lli_pool =3D dma_pool_create("at_hdmac_lli_pool", + atdma->lli_pool =3D dmam_pool_create("at_hdmac_lli_pool", &pdev->dev, sizeof(struct at_lli), 4 /* word alignment */, 0); if (!atdma->lli_pool) { dev_err(&pdev->dev, "Unable to allocate DMA LLI descriptor pool\n"); - err =3D -ENOMEM; - goto err_desc_pool_create; + return -ENOMEM; } =20 /* create a pool of consistent memory blocks for memset blocks */ - atdma->memset_pool =3D dma_pool_create("at_hdmac_memset_pool", + atdma->memset_pool =3D dmam_pool_create("at_hdmac_memset_pool", &pdev->dev, sizeof(int), 4, 0); if (!atdma->memset_pool) { dev_err(&pdev->dev, "No memory for memset dma pool\n"); - err =3D -ENOMEM; - goto err_memset_pool_create; + return -ENOMEM; } =20 /* clear any pending interrupt */ @@ -2080,10 +2074,10 @@ static int __init at_dma_probe(struct platform_devi= ce *pdev) dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask) ? "slave " : "", plat_dat->nr_channels); =20 - err =3D dma_async_device_register(&atdma->dma_device); + err =3D dmaenginem_async_device_register(&atdma->dma_device); if (err) { dev_err(&pdev->dev, "Unable to register: %d.\n", err); - goto err_dma_async_device_register; + return err; } =20 /* @@ -2092,27 +2086,15 @@ static int __init at_dma_probe(struct platform_devi= ce *pdev) * dma_request_channel(). */ if (pdev->dev.of_node) { - err =3D of_dma_controller_register(pdev->dev.of_node, + err =3D devm_of_dma_controller_register(&pdev->dev, pdev->dev.of_node, at_dma_xlate, atdma); if (err) { dev_err(&pdev->dev, "could not register of_dma_controller\n"); - goto err_of_dma_controller_register; + return err; } } =20 return 0; - -err_of_dma_controller_register: - dma_async_device_unregister(&atdma->dma_device); -err_dma_async_device_register: - dma_pool_destroy(atdma->memset_pool); -err_memset_pool_create: - dma_pool_destroy(atdma->lli_pool); -err_desc_pool_create: - free_irq(platform_get_irq(pdev, 0), atdma); -err_irq: - clk_disable_unprepare(atdma->clk); - return err; } =20 static void at_dma_remove(struct platform_device *pdev) @@ -2121,22 +2103,12 @@ static void at_dma_remove(struct platform_device *p= dev) struct dma_chan *chan, *_chan; =20 at_dma_off(atdma); - if (pdev->dev.of_node) - of_dma_controller_free(pdev->dev.of_node); - dma_async_device_unregister(&atdma->dma_device); - - dma_pool_destroy(atdma->memset_pool); - dma_pool_destroy(atdma->lli_pool); - free_irq(platform_get_irq(pdev, 0), atdma); =20 list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels, device_node) { /* Disable interrupts */ atc_disable_chan_irq(atdma, chan->chan_id); - list_del(&chan->device_node); } - - clk_disable_unprepare(atdma->clk); } =20 static void at_dma_shutdown(struct platform_device *pdev) --=20 2.55.0