From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DC29C433F5 for ; Tue, 10 May 2022 18:44:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349045AbiEJSoX (ORCPT ); Tue, 10 May 2022 14:44:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243632AbiEJSoS (ORCPT ); Tue, 10 May 2022 14:44:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AEF62A1898 for ; Tue, 10 May 2022 11:44:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E140160F2E for ; Tue, 10 May 2022 18:44:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43472C385A6; Tue, 10 May 2022 18:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652208256; bh=nteh6AJ0r/mVoLGErlwN08kpu+PDPyjBwrscK6E6gMM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c8ITZL1dSmm+7KIcn1BE2SWdv4gJmLG8b4yxs8UnXP3SxRmmJ9JRnsJbtwL3EyMkg fa5VyY2+UtEZWLnnlmKodN5xfltqzKp4Cd2HOIMxY0ImV2CrpCBm0IWkwPyXxeqaKu MeZy8laibpfybPOPGyyHLsAKsXzmLV9FEFogAetD6ugOzI4yVKrO7zwSoZDxVMmrah pBR7974MbvYolLWeTyvL/1JH2hej+mIX2J8z7iausKwb7czjJrDS3VPlVItgicsZVj 846XtbM3YYldPLoAOkDe15V3LDCT+ry/jPfufEPWnMM8SL+bsXpWce7U0SMiqik3u8 TcaQq8tZhXrBw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1noUqD-00AMwc-NU; Tue, 10 May 2022 19:44:13 +0100 Date: Tue, 10 May 2022 19:44:13 +0100 Message-ID: <875ymd6xdu.wl-maz@kernel.org> From: Marc Zyngier To: Antonio Borneo Cc: Thomas Gleixner , Maxime Coquelin , Alexandre Torgue , , , , Pascal Paillet , Ludovic Barre , Loic Pallardy Subject: Re: [PATCH 4/7] irqchip/stm32-exti: forward irq_request_resources to parent In-Reply-To: <20220510164123.557921-4-antonio.borneo@foss.st.com> References: <20220510164123.557921-1-antonio.borneo@foss.st.com> <20220510164123.557921-4-antonio.borneo@foss.st.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: antonio.borneo@foss.st.com, tglx@linutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, p.paillet@foss.st.com, ludovic.barre@foss.st.com, loic.pallardy@foss.st.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 May 2022 17:41:20 +0100, Antonio Borneo wrote: > > From: Pascal Paillet > > Enhance stm32-exti driver to forward request_resources and > release_resources_parent operations to parent. > Do not use irq_request_resources_parent because it returns > an error when the parent does not implement irq_request_resources. > > Signed-off-by: Pascal Paillet > Signed-off-by: Antonio Borneo > --- > drivers/irqchip/irq-stm32-exti.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c > index c8003f4f0457..3f6d524a87fe 100644 > --- a/drivers/irqchip/irq-stm32-exti.c > +++ b/drivers/irqchip/irq-stm32-exti.c > @@ -550,6 +550,16 @@ static void stm32_exti_h_unmask(struct irq_data *d) > irq_chip_unmask_parent(d); > } > > +static int stm32_exti_h_request_resources(struct irq_data *data) > +{ > + data = data->parent_data; > + > + if (data->chip->irq_request_resources) > + return data->chip->irq_request_resources(data); > + > + return 0; > +} Why do you need to reinvent the whole thing? Why isn't it just: static int stm32_exti_h_request_resources(struct irq_data *data) { irq_chip_request_resources_parent(data); return 0; } And this really deserves a comment. I also wonder whether we should change this behaviour to always return 0. M. -- Without deviation from the norm, progress is not possible.