Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934105AbbEOK6L (ORCPT ); Fri, 15 May 2015 06:58:11 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:53613 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933820AbbEOK6I (ORCPT ); Fri, 15 May 2015 06:58:08 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: tthayer@opensource.altera.com, bp@alien8.de, dougthompson@xmission.com, m.chehab@samsung.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linux@arm.linux.org.uk, dinguyen@opensource.altera.com, grant.likely@linaro.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tthayer.linux@gmail.com, linux-edac@vger.kernel.org Subject: Re: [PATCH 3/4] edac, altera: Addition of Arria10 EDAC Date: Fri, 15 May 2015 12:57:56 +0200 Message-ID: <2896031.Yz7YCP9E71@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1431553787-27741-4-git-send-email-tthayer@opensource.altera.com> References: <1431553787-27741-1-git-send-email-tthayer@opensource.altera.com> <1431553787-27741-4-git-send-email-tthayer@opensource.altera.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:0Pubbp/boXGQCDHPky/a3zvOIXvw2Yg5of+gdRvCdGxbvsM4gr+ wXqS5+A9bgPY7g9AYSmeZJCK7ZXieJbYbX6wfGvAdO5+7WYibo1wDjfWi+PpW3jLLfC6IGq FaKb87zH4zbzO5ruui2K0KQA1nitLiIp5s+BVTDVKI+danDrWkZBVRbAs4t51fIQCQVMVjx dPhLE5Oxgu+S5QAXi1KZA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2391 Lines: 68 On Wednesday 13 May 2015 16:49:46 tthayer@opensource.altera.com wrote: > +static int a10_unmask_irq(struct platform_device *pdev, u32 mask) > +{ > + void __iomem *sm_base; > + > + if (!devm_request_mem_region(&pdev->dev, A10_SYMAN_INTMASK_CLR, > + sizeof(u32), dev_name(&pdev->dev))) { > + edac_printk(KERN_ERR, EDAC_MC, > + "Unable to request mem region\n"); > + return -EBUSY; > + } > + > + sm_base = devm_ioremap(&pdev->dev, A10_SYMAN_INTMASK_CLR, > + sizeof(u32)); > + if (!sm_base) { > + edac_printk(KERN_ERR, EDAC_MC, > + "Unable to ioremap device\n"); > + > + return -ENOMEM; > + } > + > + iowrite32(mask, sm_base); > + > + devm_iounmap(&pdev->dev, sm_base); > + devm_release_mem_region(&pdev->dev, A10_SYMAN_INTMASK_CLR, > + sizeof(u32)); > + > + return 0; > +} If you always unmap right away, better use the normal request_mem_region and ioremap functions rather than their devm counterparts. > > + /* Only the Arria10 has separate IRQs */ > + if (irq2 > 0) { > + /* Arria10 specific initialization */ > + res = a10_init(mc_vbase); > + if (res < 0) > + goto err2; > + > + res = a10_unmask_irq(pdev, A10_DDR0_IRQ_MASK); > + if (res < 0) > + goto err2; > + > + res = devm_request_irq(&pdev->dev, irq2, > + altr_sdram_mc_err_handler, > + IRQF_SHARED, dev_name(&pdev->dev), mci); > + if (res < 0) { > + edac_mc_printk(mci, KERN_ERR, > + "Unable to request irq %d\n", irq2); > + res = -ENODEV; > + goto err2; > + } > + irqflags = IRQF_SHARED; > + } > + > Should the unmask be done after the request? Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/