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: 49559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 994B82154F for ; Fri, 5 Jun 2015 09:36:22 +0000 (UTC) Received: by labc7 with SMTP id c7sf18012971lab.1 for ; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bVTl5/wrTBhKw4YJ++4x7IjgAg3ITqCScPrPA4Mpf3c=; b=f3gyN2ibIYpcBO3Rqn/9YSw6QZjnsda2BF7k4tgURH288moJxDOaTVsmdIf/jumHhv qG/cYs006iu1+0nF5MGNYktbI1EeLMvUYYjDiggtA3Mx6icjygy9rGUZ2Gpy5cIDS8eJ +WQxUUr7LTHiHNPuvbubJVSYMU5URvvuSG9GxB9dgej6T4XpwM1scKnOHD/lMHzM2o4D 7x0CWkMg/SEX2XblzZZVh8pSGzNSdVANKO4xMXxRWpjfx3sHKBMGI9rOP87Exa4xz44S XzNkajIl+BKbqIbjTFi/qvj9prI2IwQ/V6Oq0NuO12E9xgYn9rcJ3rWDxLPQZT/0Uc6o 1mSw== X-Gm-Message-State: ALoCoQldDPs1RdmQ8U+I3H/SemYE0J4rQzbBG4uMWSybb8HT/hp30yMGIYYjND7r0FJ+v9/QTt8+ X-Received: by 10.112.84.104 with SMTP id x8mr2400325lby.23.1433496981635; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.65 with SMTP id r1ls337442lag.61.gmail; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr2516002lbc.64.1433496981483; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id l5si4345530lbt.73.2015.06.05.02.36.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 02:36:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labko7 with SMTP id ko7so50182994lab.2 for ; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr2508293lah.76.1433496981389; Fri, 05 Jun 2015 02:36:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1270349lbb; Fri, 5 Jun 2015 02:36:20 -0700 (PDT) X-Received: by 10.68.213.198 with SMTP id nu6mr4602285pbc.60.1433496979634; Fri, 05 Jun 2015 02:36:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ff5si10104854pac.199.2015.06.05.02.36.18; Fri, 05 Jun 2015 02:36:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbbFEJgS (ORCPT + 1 other); 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-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: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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; }