Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3700359ybi; Mon, 29 Jul 2019 11:02:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAg1hSJQ6UeGrZm/P4CCmn68TWcLoQ7K1FoiNmonTFVuTbJKxxJIrv5ukZjMKXPyCMobzz X-Received: by 2002:a63:7455:: with SMTP id e21mr100411610pgn.439.1564423360642; Mon, 29 Jul 2019 11:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564423360; cv=none; d=google.com; s=arc-20160816; b=C60Ffz2GKWVRzgr1hZB/1Zlly/F3bUuq8j67FF+I4uO1Mvj9+++JCKzqbCV28lFzNL l1U/c7qOoByTUh0T3+oV8qk/mGoQ+mtQTl5ms2FkO0XbN+BOo4lDhyEWjNnCYTOZ7Bv1 8qhyGS5Ocdm0++jek7RaRutpSlWngXc4cgztqG35g7C3ATrbVp2mZLri2RZDeeoM6p6P MBq9ASTKPafbhdxqAf0/fEI+J07AvYmXyG3IpQIPUWezDHJ63wcaHK1OM6YxjBq62Npv J0f/SfyNcmzQfTSbYPn5/fKJMOFpTOpdmvX0D1XhfXjBN6IpbAErsjs8y08ouFZoeyJO niUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=oenEC53evYHVSZnyEpKtcADmSKg4vmWS4aqdgYMP0O0=; b=ldV1j20xF0tRSk/1S6yzwjbuh4D3N693/KuVdB1l2e90ITH+jAU1xolweEI2wWXi0F uYk9reIFg/MAiqKs9fs7N/zT1m4Y7MTfGyfMxbW3NRErrjmiZtAMO0lxmA0/l6dhoY3r KwKh4s4uIzju1UhHZySS/PKW8ERQj+RtCcLi6k34TfsFJBt/VOPkqyn3XR/KGfDz06h3 HgGQ9tPtQi5DbFErsU5H1mD+7aItxb8Y5ibK8cuoYUuPlpfh+t9/Z0pwcVFiLtoE/Z2J SjX6s5xyNireaviVtYPALIxPjye7qRRPul0sszC2guSbZ6mhrz8M4i7D24jg2Sj2ZNwD DHZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si25472152plo.434.2019.07.29.11.02.11; Mon, 29 Jul 2019 11:02:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728568AbfG2Ogg (ORCPT + 99 others); Mon, 29 Jul 2019 10:36:36 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:42397 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbfG2Ogg (ORCPT ); Mon, 29 Jul 2019 10:36:36 -0400 Received: from orion.localdomain ([77.4.29.213]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MOiU5-1i1H9Z0xtX-00Q9FW; Mon, 29 Jul 2019 16:36:34 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org Subject: [PATCH] gpio: just plain warning when nonexisting gpio requested Date: Mon, 29 Jul 2019 16:36:33 +0200 Message-Id: <1564410993-22101-1-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 X-Provags-ID: V03:K1:9JWgj9p0cDCFvXkzCyyPTFFHU5yanSU3CHvxiYNkCzHElSYEbkv tPRRuhjIdRM6PCuiJSu+21ero9peOygXrTw1QQL2eANlCXW1Cx8F3NcDzDA8EATPG4dcc9F wxGn2EVQdZLjtVenRfAubE5+IBjjmFdwWPAcFnCLuoKL3rzIijZz8dNkxyNCajkkKrpgxlA E9ZDcM+kjTQM2hLpdKCIw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0nLuBilCz5M=:SyyZ91KbkxCbaNkDCFH0F6 TiLZDQ6jyqIT+Lyd8/zK/JN9IDiNcuo4muXwBWHIONfvyPtCcUrPb6xGn2PXjZm8RRGv4hrrk yD4TV53hPrFEkoBRQ20RXJgvrA0cN3bDf1qa8sx8fFffbWnF1zNoyjo97SQWWUY1RxHfZCQyD F2g3vix3FIJ1vHKJ/iI9mkKyUKm0U5fflFwo9YH1Uf3/bU59s9eUO6RnjELgClYB7KYSerWgr A/U10ZlIh6k6h5bfu3X6woziwbx1REehB2u+eclTo5kl9DrqiUoUL4ATETEaA3z6ExPTsayVw LN6dE1PcKW+PSESZ7D8ptqyiV4ifLF44oKqsMJRwxlYemG0xhb2p8HAbuojCatrE8iRXS/xKo 1ljDzfTaXqExNs6bJkB6j6aTWETY3fxlCw/9uh1S7f2zYk0Lzngnv5cSKKddPmf3dwvKoKSoi XXJHvHacv1tW9tzSf2WRVhssRQAAKB2lPPJ9/fZFWiP1o/ckMH4i79ES9hJSyiN8EAWN2ek9A gHDfyicvZ9tv7eHyMLX9YfiDFeDRdrJpypPU8c7PXajyBPgU+/iw1uchJXjOfvJ5gF7mucUro Xdx8ReVJFUNnxTONws7kK7G0XBLsWCngQL8sPAQXKUKnonsmN7/488oCY4Ef7UuPSKP6/kiDo RmKDqNWTgfSmeA9JrAnKNzvZS4m1zpzABuUZe6/dyTg2iginaoc6lNylBT5I3M/nRQhCdTi4h qEl0SX5bTZGFdMdARGeWyrIcM16dKZ16QbvouQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Enrico Weigelt When trying to export an nonexisting gpio ID, the kernel prints outs a big warning w/ stacktrace, sounding like a huge problem. In fact it's a pretty normal situation, like file or device not found. So, just print a more relaxed warning instead. Signed-off-by: Enrico Weigelt --- drivers/gpio/gpiolib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3ee99d0..06eeedd 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1,4 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -121,7 +124,7 @@ struct gpio_desc *gpio_to_desc(unsigned gpio) spin_unlock_irqrestore(&gpio_lock, flags); if (!gpio_is_valid(gpio)) - WARN(1, "invalid GPIO %d\n", gpio); + pr_warn("invalid GPIO %d\n", gpio); return NULL; } -- 1.9.1