From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Murphy Subject: Re: [PATCH] iommu: arm-smmu: use devm_request_irq and devm_free_irq Date: Mon, 11 Jul 2016 11:32:55 +0100 Message-ID: <578375D7.7090609@arm.com> References: <1467625102-9755-1-git-send-email-van.freenix@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1467625102-9755-1-git-send-email-van.freenix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Peng Fan , will.deacon-5wv7dgnIgG8@public.gmane.org Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: iommu@lists.linux-foundation.org On 04/07/16 10:38, Peng Fan wrote: > Use devm_request_irq to simplify error handling path, > when probe smmu device. > > Also devm_{request|free}_irq when init or destroy domain context. > > Signed-off-by: Peng Fan > Cc: Will Deacon > Cc: Robin Murphy > --- [...] > @@ -2050,7 +2046,7 @@ static int arm_smmu_device_remove(struct platform_device *pdev) > dev_err(dev, "removing device with active domains!\n"); > > for (i = 0; i < smmu->num_global_irqs; ++i) > - free_irq(smmu->irqs[i], smmu); > + devm_free_irq(smmu->dev, smmu->irqs[i], smmu); There shouldn't be any need for this at all, since the very next thing called after drv->remove() is devres_release_all(). Robin. > > /* Turn the thing off */ > writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0); >