Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13851050pxu; Mon, 4 Jan 2021 06:17:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/wNFADQWabgKhg5QhnDijV4KTcAsn5ikof69uS5fY3JRiTEbQmS9+RqpbR8O6MNlYnKMr X-Received: by 2002:a50:fc83:: with SMTP id f3mr72068491edq.219.1609769841298; Mon, 04 Jan 2021 06:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609769841; cv=none; d=google.com; s=arc-20160816; b=N47pVU40gXhJ/Mn0rqoAsJudt0D3kvnxl1PjEC1evKmOo6qI37Jor0B/4Jm3b2st6p eoJio1sqMtow1AslJHjwlrYNGRcTCEJDv5ed50aX/3xHj7OOdDDYIuA2ze+tbVx/g9+v EoR46zKsYTGlytfqXtmJAoMA4dcnumf8btO7oui5oxmd3KDKQZPsfhMt+SoycsuEbDgj JLHE8jF7K37tNP3BEtqTkiYTMBgSiUUmrjkbCXZxJcglqFBJmVUhDJ1b1HcTqZW9y+V4 J+QR8fCAwZA4qALWS/MTWlgPjqtQHz6mwwdGTT3g3JS5o+nLYejKIKvYHAceOGFl4XHr 3UIQ== 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=CCxd/PUSwUofs28XjI+jmkN/DEXzfHZxj/dT0gyHcnk=; b=x5WHFl6WEQS7GVyG9eOoEDv+bMaB2Qf8Ko7fq/7zAWJSVheChaiS8lLtOwNkQ52eEt 69b+5rH3N+3HI/shz4NZMEx2o/HT78MgJUOBd68c0eCtC5moYtpHX39WiN70ixROJseL V8i7rdp98GoDkYk7Ii0+pcxBzzQJunWqRcBVwsCb+rLg1I54u1d91/rxNGTOnnbwOFmM /ql7zejHWAOXMBanRLLYrJeW4Iaer9+g0WR0P+l33Fhs+d2HFr1fbl83nVvBHPjcsY1M hs6u07Ly9ZUvKrdfEl5Wqr6C++CXc1i/HRJWlZZ6I6E+rYKu4zFKF6KRhFPSR1yTTr/u wYWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VHjNnt2s; 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 e20si29427019edr.131.2021.01.04.06.16.58; Mon, 04 Jan 2021 06:17:21 -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=VHjNnt2s; 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 S1727181AbhADOQA (ORCPT + 99 others); Mon, 4 Jan 2021 09:16:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727164AbhADOP7 (ORCPT ); Mon, 4 Jan 2021 09:15:59 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF64C061793 for ; Mon, 4 Jan 2021 06:15:19 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id b73so27456991edf.13 for ; Mon, 04 Jan 2021 06:15:19 -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=CCxd/PUSwUofs28XjI+jmkN/DEXzfHZxj/dT0gyHcnk=; b=VHjNnt2s4dQeSW9LopBNt9rWpaKMF9XN+LBbbACmtxwZnGiBIurK/5FsVB5AzmS+Mc 0yRYeWtNDGAsC+owrj+8qKPfsDTGYhutapyGAfMsAgmECMtKlzJm+pHQsK8Aic1qNvRs SkrqF2XydKJz3jDPCOeh23IfQvNWOVSvMRbKwGy+nMbEEHGjPs9W7AolHvo//KUmxFpa X4Cj/5PEqiCdYomqICsT63KOwTqLdyNK/i/gISskuKBd+lkcO6CmGiNzgja5MC7xCxiZ L+yUkxqYre2hA515uEllcPlA853IVtamqZMKAUWWXVzWEmIz/v076EAhiwlGmhHHmz/J nC/w== 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=CCxd/PUSwUofs28XjI+jmkN/DEXzfHZxj/dT0gyHcnk=; b=ljNs3UMW4z1df9peIdPLmRp0BlZw5kh8ACRzQo6fWXLOG66tbBvJmYaFwqlULiI5St ycHQ0Sokqz8bvu+AaNtRMjESmZ/mFQmwsykMVwZ4S4aaAQaDMVKgfF0aIkIkar7uJ0st tULnzqjLHQMkHcQfTd3jAt8E8ndWwk8xftLF8jatE1LBgxRXiVyzNGA5YvfeIyHPUnR6 xwU23fJbD3wpNf5CdRJd8K/2/4LxVdlxQ4muIgIQxS+GAMxr+XR04xe/a1mNeWbhcq27 S7PlXcL1kBk2dVvw3SmJOQ/MdtKQTkVJSpcy+QeIcjh3SsB3kfo1WTFCjS3MZtpMrTZc TjAQ== X-Gm-Message-State: AOAM533aZpLAkH0sDpeh8FafO75XN25TSwKF2wYePN6OXH3wDDbiGFkQ LiiAGIUpWfD9psCEv8hzDTPFOxB/Hgg5ZZJvspgOoQ== X-Received: by 2002:a50:b742:: with SMTP id g60mr70299542ede.113.1609769718075; Mon, 04 Jan 2021 06:15:18 -0800 (PST) MIME-Version: 1.0 References: <20201228150052.2633-1-nikita.shubin@maquefel.me> In-Reply-To: <20201228150052.2633-1-nikita.shubin@maquefel.me> From: Bartosz Golaszewski Date: Mon, 4 Jan 2021 15:15:07 +0100 Message-ID: Subject: Re: [PATCH] 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, Dec 28, 2020 at 4:02 PM 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 > --- > drivers/gpio/gpiolib.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 5ce0c14c637b..44538d1a771a 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_err(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 > I know Linus suggested using chip_err() here but since this doesn't cause the function to fail, I'd say this should be chip_warn(). Unless Linus has any objections, please change it. Bartosz