From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756674AbcKKNuI (ORCPT ); Fri, 11 Nov 2016 08:50:08 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:56365 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756622AbcKKNuG (ORCPT ); Fri, 11 Nov 2016 08:50:06 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Fri, 11 Nov 2016 13:50:13 +0000 From: Charles Keepax To: CC: , Subject: Re: [PATCH 2/2] mfd: arizona: Correctly clean up after IRQs Message-ID: <20161111135013.GJ1575@localhost.localdomain> References: <1477650774-22239-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <1477650774-22239-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1477650774-22239-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611110249 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2016 at 11:32:54AM +0100, Charles Keepax wrote: > Currently we leak a lot of things when tearing down the IRQs this patch > fixes this cleaning up both the IRQ mappings and the IRQ domain itself. > > Signed-off-by: Charles Keepax > --- > drivers/mfd/arizona-irq.c | 54 +++++++++++++++++++++++++++++++++++------------ > 1 file changed, 40 insertions(+), 14 deletions(-) > > diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c > index 2e01975..fecf367 100644 > --- a/drivers/mfd/arizona-irq.c > +++ b/drivers/mfd/arizona-irq.c > @@ -207,6 +207,7 @@ int arizona_irq_init(struct arizona *arizona) > int ret, i; > const struct regmap_irq_chip *aod, *irq; > struct irq_data *irq_data; > + unsigned int virq; > > arizona->ctrlif_error = true; > > @@ -318,24 +319,34 @@ int arizona_irq_init(struct arizona *arizona) > } > > if (aod) { > - ret = regmap_add_irq_chip(arizona->regmap, > - irq_create_mapping(arizona->virq, 0), > - IRQF_ONESHOT, 0, aod, > - &arizona->aod_irq_chip); > + virq = irq_create_mapping(arizona->virq, 0); > + if (!virq) { > + dev_err(arizona->dev, > + "Failed to map AOD IRQs: %d\n", ret); > + goto err_domain; One minor issue here we should be setting ret, as this one hasn't been applied yet I will send a new spin shortly. > + } > + > + ret = regmap_add_irq_chip(arizona->regmap, virq, IRQF_ONESHOT, > + 0, aod, &arizona->aod_irq_chip); > if (ret != 0) { > dev_err(arizona->dev, > "Failed to add AOD IRQs: %d\n", ret); > - goto err; > + goto err_map_aod; > } > } > > - ret = regmap_add_irq_chip(arizona->regmap, > - irq_create_mapping(arizona->virq, 1), > - IRQF_ONESHOT, 0, irq, > - &arizona->irq_chip); > + virq = irq_create_mapping(arizona->virq, 1); > + if (!virq) { > + dev_err(arizona->dev, > + "Failed to map main IRQs: %d\n", ret); > + goto err_aod; ditto. Thanks, Charles