Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2707088pxb; Tue, 19 Jan 2021 04:15:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwR09v+dB4bEIglne9acTpN5tEJB0UoPmha7HL5jZtk5YWHrTo77ME5lacaBrkdm3P66+O X-Received: by 2002:a17:906:68d1:: with SMTP id y17mr2735556ejr.293.1611058505388; Tue, 19 Jan 2021 04:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611058505; cv=none; d=google.com; s=arc-20160816; b=q+BfZoFeatSpaJ7GxCI7tC3OSvVXoIuOBiupDz6f1+KWVMIdQeQvXkmMBt/jdLCnXw IJ9yHNsuWBRcr+xKyY2kDSFSnVPnn4GEkF4sxMDqS0EP8nBtN2s9Zqq7RE0cTxel25ER 9BiXSTN9G8FkMETLg4rmdNYgjDhw7W7vz+mo5wffKMN0THQnZt/wVtMA17R2O+31Wo8Q bBYKn4yUfdCEmTMz8pk0kUi+OXy9YiARfnpXpb6I3NyDKfJOqKlN2NfrtY/9HOO7IE4V ITgQeltXJFWodFHLzThnwEjYSIF1cnuPIxlyIdTAjka/TU/y0NtkfzJK6OA1MJ8hwG4Z 0YuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=S5vcWLYKoGwyM8t/8S/E9AoWHkff5piFNbt11pwE+L4=; b=OBAADFtu15iNJ6bjbAnuEPm2V+LGL37E7r/i3KSDPpt7BT/49+S6C9/1L8xyoJ/u8U ZVOgCRZuJLY0iWi3tI2WU75mdDmWmZl4iQl2m59OpH57JJzSGbWMg4JxiPyRBmETNJac iM4aWL+4bet5dcV1b50Ae/icGCugX6jGa5qVwe+MXG6IiHlzFdY/L+c/QOCEH04LgVWA DBOU8LOE2XQ34xaa3FBXXja8ZFN/uJ40mvs9tOeGuWeJG9OpGzjnV9FYQ7j/fyYSaeK6 Utaxz9O/lbGvR/3DsotoX1KjgP+xhpS0DxzKPRGxXYsdSfVffEXPAd/G7FP5SH9xwejg OHrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=OYNL7Mmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si3817115edx.245.2021.01.19.04.14.08; Tue, 19 Jan 2021 04:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=OYNL7Mmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405012AbhASLBi (ORCPT + 99 others); Tue, 19 Jan 2021 06:01:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391069AbhASKwo (ORCPT ); Tue, 19 Jan 2021 05:52:44 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280C7C061574 for ; Tue, 19 Jan 2021 02:52:02 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id n6so5857077edt.10 for ; Tue, 19 Jan 2021 02:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S5vcWLYKoGwyM8t/8S/E9AoWHkff5piFNbt11pwE+L4=; b=OYNL7Mmt90KQttNu8O6EHRPz5gOXvj4jjK26OTEkQyAIdkbb3CaAZLJ/fjlvehiHDt 04W6iTXTXisPI2DB1+3MVgnjCmzCL8H1S/2u9tNewftXOUjpEYamX3kHCzDeYOvLjZHc yRLV30F9RQsz7tLFFqL1mVQC9TUmaxG/SJk0qcxZMhQM4o6uNVuL6uf49rriGVZbxL49 ENHNohylxEmqORe94erBKgn4OI/3yNyZKcXkEM2mxzLbC4QPb4tBOb3p80Xc2QM0VM7T LZAxtcITNI29oCCWjJiFLOq+hulglwVJR1AgopBDac1b2Sb3cDeRlC1u7zv83pntoz+j zN+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S5vcWLYKoGwyM8t/8S/E9AoWHkff5piFNbt11pwE+L4=; b=NA8fANo1uvGKB/hKx/j5SjcELmq/ZCTv7mvV/pirOH2M6urcI3xy9XfLK2Mtt53Q4C DG9nEnQ+SfyAuBZJdmDSK7qzG1ZWX7KiJasQKMrRpEJOSI46k/7melyzj+1sy/UF7wf3 CFo1VFC5MUJnAXtbFARA0rNON+P/8868rePw7lmPw1e8jpDY6NexJ9/eYa0yavwDrKIZ ROfmiQpDGcivx97/6jMpuVhF9SUQ/CWalGtghocoYUtnHZfYMh8hL66TID+ncLsDDBr7 rUFZKi8m6xVO66GqFgu0/wNZDmkAQATZ5r4rSEIkK2JVQOzKp/ioA1R6Pyiht+ODwrK0 JnKQ== X-Gm-Message-State: AOAM5323LTtXHEIcX6nHBmiEx2v0sUWp6IRnYIBDtftGMsHiEpcmlARN ibjOs1ODmz6DMaHf5EHi+lFqnRvUtlr/KQSI7aSi8A== X-Received: by 2002:aa7:ca13:: with SMTP id y19mr2817438eds.59.1611053520922; Tue, 19 Jan 2021 02:52:00 -0800 (PST) MIME-Version: 1.0 References: <20201228150052.2633-1-nikita.shubin@maquefel.me> <20210118090508.21686-1-nikita.shubin@maquefel.me> In-Reply-To: <20210118090508.21686-1-nikita.shubin@maquefel.me> From: Bartosz Golaszewski Date: Tue, 19 Jan 2021 11:51:50 +0100 Message-ID: Subject: Re: [PATCH v2] gpiolib: warning on gpiochip->to_irq defined To: Nikita Shubin Cc: Linus Walleij , Grygorii Strashko , Thierry Reding , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 10:05 AM Nikita Shubin wrote: > > gpiochip->to_irq method is redefined in gpiochip_add_irqchip. > > A lot of gpiod driver's still define ->to_irq method, let's give > a gentle warning that they can no longer rely on it, so they can remove > it on ocassion. > > Fixes: e0d8972898139 ("gpio: Implement tighter IRQ chip integration") > Signed-off-by: Nikita Shubin > --- > v1->v2: > - Change chip_err to chip_warn > --- > drivers/gpio/gpiolib.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 5ce0c14c637b..5a9410c2537d 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1489,6 +1489,9 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, > type = IRQ_TYPE_NONE; > } > > + if (gc->to_irq) > + chip_warn(gc, "to_irq is redefined in %s and you shouldn't rely on it\n", __func__); > + > gc->to_irq = gpiochip_to_irq; > gc->irq.default_type = type; > gc->irq.lock_key = lock_key; > -- > 2.29.2 > Applied to fixes, thanks! Bartosz