Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbbHCI4U (ORCPT ); Mon, 3 Aug 2015 04:56:20 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:34358 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752078AbbHCI4S (ORCPT ); Mon, 3 Aug 2015 04:56:18 -0400 MIME-Version: 1.0 In-Reply-To: <55BB8C23.1050200@ti.com> References: <1438346937-9020-1-git-send-email-rabin@rab.in> <55BB8C23.1050200@ti.com> Date: Mon, 3 Aug 2015 10:56:18 +0200 Message-ID: Subject: Re: [PATCH 1/2] gpio: don't override irq_*_resources() callbacks From: Linus Walleij To: Grygorii Strashko Cc: Rabin Vincent , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1140 Lines: 32 On Fri, Jul 31, 2015 at 4:54 PM, Grygorii Strashko wrote: > On 07/31/2015 03:48 PM, Rabin Vincent wrote: >> + if (!irqchip->irq_request_resources && >> + !irqchip->irq_release_resources) { >> + irqchip->irq_request_resources = gpiochip_irq_reqres; >> + irqchip->irq_release_resources = gpiochip_irq_relres; >> + } > > I think, it will be better to handle req/rel cases separately. No, I think that could be dangerous. The semantics of the both functions are intertwined, if we change something in the core we may break drivers. It would be better with a mechanism saying "also do this on irq_request/release resource" so a secondary vtable for these two. Where the latter would be optional per-callback. That way the ETRAXFS does not need to reimplement irq locking. I'll see what I can come up with. Yours, Linus Walleij -- 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/