From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbbGSJIx (ORCPT ); Sun, 19 Jul 2015 05:08:53 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:25688 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbbGSJIw (ORCPT ); Sun, 19 Jul 2015 05:08:52 -0400 X-IronPort-AV: E=Sophos;i="5.15,502,1432591200"; d="scan'208";a="170801470" Date: Sun, 19 Jul 2015 11:08:49 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Zubair.Kakakhel@imgtec.com cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: question about drivers/dma/dma-jz4780.c Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The file drivers/dma/dma-jz4780.c has a probe function that sets up irqs using devm_request_irq. The probe function then ends with: err_unregister_dev: dma_async_device_unregister(dd); err_disable_clk: clk_disable_unprepare(jzdma->clk); return ret; } The remove function, on the other hand contains: of_dma_controller_free(pdev->dev.of_node); devm_free_irq(&pdev->dev, jzdma->irq, jzdma); dma_async_device_unregister(&jzdma->dma_device); The need for calling devm_free_irq explicitly would be that it needs to occur before dma_async_device_unregister, to eg avoid a reference to a dangling pointer. But devm_free_irq is implicitly called after the call to dma_async_device_unregister at the end of the probe function. Which one is correct? julia