From nobody Fri Jul 24 05:21:29 2026 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 1F672299A82 for ; Thu, 23 Jul 2026 05:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784783256; cv=none; b=LIosPUeWYxfs7VNzlz2luH+jwxMc/jbqGY5p933xvXxWvGJtYgseCkbpUnuExZgY85RwgU46Ip6SygrZ1t4NHqsrPOYCcPSgIib2iiJFPtlUiTD1HOwEU8RBLousJd187GjKSgRfOVAqBLf+KghL3BNYA0nHwpeJWxU4xU9nl7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784783256; c=relaxed/simple; bh=0ct5qBNzZlj1YvmNbMAPQp4oV2Yi3iJWR+0NsTusnd4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IguXetMEiRjSiflZIZ7JJVr24LZeDnHmHykNqSbBONsQ8u1Glvuep6HcfjEbkabjF02mGj/VkRH4LXiKRmsKTgF576kVqQICh9DnVVk8n4TFtz7POhtg62hNtS7+M84HfC8ktTURum4C9Pc7+c+UKqEuUWiQuF4GTX9qgiPTVRs= 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=AdUIuI5P; arc=none smtp.client-ip=209.85.215.173 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="AdUIuI5P" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-c9ef3e1337fso174291a12.2 for ; Wed, 22 Jul 2026 22:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784783254; x=1785388054; 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=2mn31q9tQU1OehKqhUUtfCvCnBZjiisREJ8x835WzvQ=; b=AdUIuI5PV2hdSDuBfbQnG6/axBFFBu8bF48kU/Hw/quvW30KjS9G+UIc21hqZCq4Hy X546+72vtuuPHvjnNdm5EzYGadl0fDluEtPbcKTICoCuqmpXUnB754CMSt/iybQ2+mkt LU24FRP2j/+De8K8pRvNolHZgdqRJri4WfkL0eAwhnypnjFb9JKDcqp64td0vZN9Ybke a7RfA47zYuBDX+TxCRq44U36c50k7Q0XZtPSB52wQoKwjwLW2GYjMWWmCHxPnpKy376K JPCVjbzZraIUydI5eBPnFLXhsxzf/AO6IdIwe+snQbmoDiPL6rqhQ7UAP4YJftHa8E84 mfeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784783254; x=1785388054; 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=2mn31q9tQU1OehKqhUUtfCvCnBZjiisREJ8x835WzvQ=; b=OaJ995gPPjSzygSU151O1IVgrl61IlXA6RpB4lHbJ48+F39P0SXRoDu81VPz1cT8rv BKlCDD6nQrQPr+mF9xeugexVWE72O2TfUKcviLBZ+OHKMPnnSvdm+MwRLfNFYKnWdIJI iV5SaFNvElsoypzL839Vk39bYxeLiWLD9zzB3CNSGf27FkOg2VsqibTOOANTxpudCv46 MMXFhv2fg6UQt1nvKYa2h5Stx7cqhEgHMYtun0Upxq2NpsCB6CD0TuQj3ZSynvMipCa9 oB/2FIvwNcma78iCInRIkG+QQitoZop2/0umPaSUzCZp83mi+Fr0INIFnAf0dkiNHEIm dNiA== X-Forwarded-Encrypted: i=1; AHgh+RpvL9sl2BtKeCg+bbcbyuFABumv0/jKAcxlWDDJiu5RNDKuqLSzqf+dWD1BWy0UvQR2G7kuajD5GVpgGD8=@vger.kernel.org X-Gm-Message-State: AOJu0YwHBupZd8LHPAykuBwNrqT1YALBKSPKWzjTV2Rh2CTk0SgCpU1G wKBPYAljcnYnIkrfziuzIhPXCHbjCUO11i1dzZ/2p4cyd0rvxXjdy5oz X-Gm-Gg: AR+sD10R3dr6BkVZDsZE06l+nmdU0W7bSLEWhxDn5XyPvWnea5nWxS07+/nCT4b2Tf4 749eCeR11LBGk0I5lf7uJ2zszoDgbF5vfryDHKQqi9RJrflacZQ/C76pNyHCu5qt2Wng/dQmFdT P1SGd7pmXlLE+k7mZvbf8/mJ1rsiYxLjcx6PCIk0GAZKRexqHk5QJsZxSa/W5/WL3AgZx9tpuH7 zkHVi6DrU3028ufTBWwN9dHQ5G1FjZg2rd7EPBSFDRw2rkO3q/+LRLLrOeJtd/xypJfuxpgAdLv e2dKFqLkWE1829svuEV/uKDuUYG0Ijc6EkAfOQ9/l5plEQk16V7mLh36tr1eFRmzMmd6imD6f2w 9ZwePoy1DSmC9CD1uEtLslI2/yhE++GAfhc5AXPZT5pmV9k/67JTOqN/phvK66JPBDHpXLVx6jn HVhfCE5yZurwb53z6xWg8GTQZFo+quJi7P/9XT40K+ld/JbScFKUYiwFC5xnlezaYMc23OOqTeA qU2Wn7KOC8eGRt2cxUiKFwh4WlegObqFV9ebpfM29V9AVwcLTQo5f2DHIzZCB9A0w== X-Received: by 2002:a05:6a21:6f12:b0:3b4:5c70:ca3e with SMTP id adf61e73a8af0-3c44b01327emr1596136637.25.1784783254443; Wed, 22 Jul 2026 22:07:34 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbb8f02e454sm2100411a12.0.2026.07.22.22.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 22:07:33 -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: [PATCH] dmaengine: at_hdmac: use more devm in _probe Date: Wed, 22 Jul 2026 22:07:32 -0700 Message-ID: <20260723050732.290935-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 --- drivers/dma/at_hdmac.c | 49 ++++++++++-------------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index e5b30a57c477..25d846ed7a7b 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,13 +2103,6 @@ static void at_dma_remove(struct platform_device *pd= ev) 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) { @@ -2135,8 +2110,6 @@ static void at_dma_remove(struct platform_device *pde= v) 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