Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2390831ybl; Sat, 24 Aug 2019 16:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3J2XvJu2ttWyof/P9aUdRd3TlbSXND+Ocj74Zr0ThDrMnCb1Y5ilRACNgYfzwY2+W1Y1e X-Received: by 2002:a63:4e05:: with SMTP id c5mr9722000pgb.396.1566689932502; Sat, 24 Aug 2019 16:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566689932; cv=none; d=google.com; s=arc-20160816; b=HU6Fk/voRx4SGig8wGW7lGWmRFAF63woBwh2g2pSQjKKq7E3mcn7pgBxudkiSZ9GoH nwy1aJLooie7SQ93wFBhAg/9h6zVAyAaOSP3kY3+i2CZS+7gCAlkk26qufSvmIwGd939 /a8nBr0gqF8dGzaPK+GYv8zuLYQ18xQ/vCzVocPKDG6ofJaigjjrlZwj7txMc2sPAXuw VaertAtNIVdNCfn6ZyFUIf1Awuvybg2VX99r2QJRZjzHwRbiK6RRaJ9IFjrZ/7lfvmzq t521M7UmlOzjmz6ZB8enfWdNXxtCjezy7kTRdUyzkHtJd0WOd7ML52ht6LBk5ukMW0ah vxOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vQlJkUpDjuK5QOb3S7/kt3dOrP3MCvIHRb/xWT9HIm0=; b=RZKvZ5+Z1W9jfdohFeg/tf2x5gWHQO9Lq02eKDgO+eVWJ7scjQQN/BNWlrW1uKFkoZ dpakHGQ2eRMgM/Bc+G57w3JyIEybcNLCFq9I2vPbgtyBa43x2OcpXaFPlk8ESlcTC0O6 P4vJ07eVXan24CJEbTX96urYpl+Lz5hPcpQIxKEquJ4BYzNv08MN0Px/mKsdzNXoae67 s4YOY1VC10qlLEl/m/wDEyAccqWyRMu64YjorZTudifxZJ5TaRBRwHDTnoJnEhILPRLz QSj79bNFmM1nWpWOtyWUxY/AOOgKT2RlNoAp78qi/+0qH0sEGKRJUfchgDV5Ol15wgiV IIIQ== 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 f6si5828025pjw.43.2019.08.24.16.38.37; Sat, 24 Aug 2019 16:38:52 -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 S1728320AbfHXXhq (ORCPT + 99 others); Sat, 24 Aug 2019 19:37:46 -0400 Received: from antares.kleine-koenig.org ([94.130.110.236]:40764 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbfHXXhp (ORCPT ); Sat, 24 Aug 2019 19:37:45 -0400 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id E542D77F67F; Sun, 25 Aug 2019 01:37:43 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andrew Morton , Linus Walleij , Bartosz Golaszewski Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v1 2/2] gpiolib: print an error name instead of a plain number in error string Date: Sun, 25 Aug 2019 01:37:24 +0200 Message-Id: <20190824233724.1775-2-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190824233724.1775-1-uwe@kleine-koenig.org> References: <20190824233724.1775-1-uwe@kleine-koenig.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an example that makes use of the just introduced printk format %dE that prints (e.g.) "EIO" when the matching integer is -EIO (or EIO). Signed-off-by: Uwe Kleine-König --- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index f497003f119c..b50ea24f087f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1247,7 +1247,7 @@ static void gpiochip_setup_devs(void) list_for_each_entry(gdev, &gpio_devices, list) { err = gpiochip_setup_dev(gdev); if (err) - pr_err("%s: Failed to initialize gpio device (%d)\n", + pr_err("%s: Failed to initialize gpio device (%dE)\n", dev_name(&gdev->dev), err); } } -- 2.20.1