From patchwork Fri Jun 5 09:36:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 481126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2B37E140281 for ; Fri, 5 Jun 2015 19:36:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbbFEJgS (ORCPT ); Fri, 5 Jun 2015 05:36:18 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:35122 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbbFEJgR (ORCPT ); Fri, 5 Jun 2015 05:36:17 -0400 Received: by labko7 with SMTP id ko7so50181491lab.2 for ; Fri, 05 Jun 2015 02:36:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=02aGFteOPm5zs1VucFudJ3U9eOx2QUP3XlWN0WN7X5M=; b=U2FwxdayswFvGXwLNti3VvbHaEu0z+bNKDB1DwNFdtz9ieVVZ/YE/N2iiJXl8/MBbm JteHdxy7V8Yhh/8Vjv0gzGbzCRRRFMF9lDS9PJtJUFK7L4rogjXd/zAfVEcN7IIs4Co4 ligQOFQ528L5rDcUQQDrssfiAN5vnuWn3GAzewmCzTufc2gFw4nyjcBYWz8Ig4+bzDT6 k+YDvVOVS/pCYr0q3I7dCmnA9YfQPdBDtqt8th5cIAwgn/xaspA3LbS1CD7wISzStXOA fS78A1VfOWhFNktebEmKu77/n0HAgPgKSRIGxxAJeVJ2WKgzilP0KLh7IcKbeJmZH3Yi AtGQ== X-Gm-Message-State: ALoCoQn22ri8d6nwjEyuDo+ccZSJkoMYI4aIoUmRf14Rta84040c0H7xiIb67Gc/Vm96IW0gB1NO X-Received: by 10.112.164.66 with SMTP id yo2mr2483321lbb.33.1433496975776; Fri, 05 Jun 2015 02:36:15 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-d37f71d5.01-192-6c756e10.cust.bredbandsbolaget.se. [213.113.127.211]) by mx.google.com with ESMTPSA id h7sm1617970laf.1.2015.06.05.02.36.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 02:36:13 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH] gpio: improve error reporting on own descriptors Date: Fri, 5 Jun 2015 11:36:10 +0200 Message-Id: <1433496970-20392-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.2 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When requesting own descriptors through hogs, it is useful to get some details about what's going on if we encounter problems. Signed-off-by: Linus Walleij Acked-by: Alexandre Courbot --- drivers/gpio/gpiolib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 4861b2db2edc..2d01a691060b 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2118,13 +2118,15 @@ int gpiod_hog(struct gpio_desc *desc, const char *name, local_desc = gpiochip_request_own_desc(chip, hwnum, name); if (IS_ERR(local_desc)) { - pr_err("requesting own GPIO %s failed\n", name); + pr_err("requesting own GPIO %s (chip %s, offset %d) failed\n", + name, chip->label, hwnum); return PTR_ERR(local_desc); } status = gpiod_configure_flags(desc, name, lflags, dflags); if (status < 0) { - pr_err("setup of GPIO %s failed\n", name); + pr_err("setup of GPIO %s (chip %s, offset %d) failed\n", + name, chip->label, hwnum); gpiochip_free_own_desc(desc); return status; }