From patchwork Mon Feb 8 14:32:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 61412 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1472512lbl; Mon, 8 Feb 2016 06:32:52 -0800 (PST) X-Received: by 10.98.64.83 with SMTP id n80mr42606980pfa.149.1454941971987; Mon, 08 Feb 2016 06:32:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89si34995471pfp.25.2016.02.08.06.32.51; Mon, 08 Feb 2016 06:32:51 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbcBHOcu (ORCPT + 4 others); Mon, 8 Feb 2016 09:32:50 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:33629 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753606AbcBHOct (ORCPT ); Mon, 8 Feb 2016 09:32:49 -0500 Received: by mail-lb0-f177.google.com with SMTP id x4so84991433lbm.0 for ; Mon, 08 Feb 2016 06:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=bNMbxvpy7p6zB82lC/soloLGtSit8vvM3gEStFn9uAU=; b=DLYcsh4KC/ElSCQ3sETOj5R8y5GzHAzqjBRsMpLgBW0mjpkoLXfkWZbo3jIbXEVVMr bwoAWE3XKqb5b+d5BGaWJNLEkjQ16UIDx/3iJUxDddSxlGKw4fARR4MQClYBnMJigkpp SQawUXd8qoIDoia8pJwUlExpB16BdmD4ekaGI= 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=bNMbxvpy7p6zB82lC/soloLGtSit8vvM3gEStFn9uAU=; b=HZs40yNt5qcoYnIRfaiTO5ZnleOj9QfcB7bNIaNW+qSAQoPGlkiePzXNGm2b7roygo 9bmzWtD33DumJtdhmHtNqLDudQRgsALNiphR+8wzhpwBaE2fN0dAiz9rPMy7NcvnwWpC hMaThyjDmAi0jBkRC3P2U9R8g9Oq79nz7s6srwToTKZ2gunI3ThOy7DdT96gc6GnfgUW nQHl+HpeTSgR+1EDtFGN344ZTk95xZPVwdVarX3GfmZFLZMw3ljY6/xzCuO+Fnguu4IO xchz/NupK5e4knnkB+yBsEOjfaGYAPSFMEqpw5KrXP+MrTASkSfUcHm4uyuUkbFxgy21 2Hug== X-Gm-Message-State: AG10YOScVIjYAdW/wwJ/rntfL+jLsYGZ+dFpjAeIt514jvgFNRfwRUxPrVF1SEaqEEe7V5BO X-Received: by 10.112.16.168 with SMTP id h8mr11295005lbd.90.1454941967763; Mon, 08 Feb 2016 06:32:47 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id jr10sm4006333lbc.42.2016.02.08.06.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 06:32:47 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot , Johan Hovold , Michael Welling , Markus Pargmann Cc: Bamvor Jian Zhang , Grant Likely , Arnd Bergmann , Mark Brown , Greg Kroah-Hartman , Dmitry Torokhov , Linus Walleij Subject: [PATCH 2/6 v3] gpio: refer to gpio device in prints and debugfs Date: Mon, 8 Feb 2016 15:32:40 +0100 Message-Id: <1454941960-25461-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We use the new struct device inside gpio_chip to related debug prints and warnings, and we also add it to the debugfs dump. Cc: Johan Hovold Cc: Michael Welling Cc: Markus Pargmann Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib.c | 6 +++--- drivers/gpio/gpiolib.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3a073ab5e863..4b94e31a50af 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -304,8 +304,8 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc) gpio = gpio_name_to_desc(gc->names[i]); if (gpio) - dev_warn(gc->parent, "Detected name collision for " - "GPIO name '%s'\n", + dev_warn(&gc->gpiodev->dev, + "Detected name collision for GPIO name '%s'\n", gc->names[i]); } @@ -528,7 +528,7 @@ void gpiochip_remove(struct gpio_chip *chip) spin_unlock_irqrestore(&gpio_lock, flags); if (requested) - dev_crit(chip->parent, + dev_crit(&chip->gpiodev->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); /* FIXME: need to be moved to gpio_device and held there */ diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index feea2c823e47..3f329c922f5b 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -174,17 +174,17 @@ static int __maybe_unused gpio_chip_hwgpio(const struct gpio_desc *desc) /* With chip prefix */ #define chip_emerg(chip, fmt, ...) \ - pr_emerg("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_emerg(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #define chip_crit(chip, fmt, ...) \ - pr_crit("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_crit(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #define chip_err(chip, fmt, ...) \ - pr_err("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_err(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #define chip_warn(chip, fmt, ...) \ - pr_warn("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_warn(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #define chip_info(chip, fmt, ...) \ - pr_info("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_info(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #define chip_dbg(chip, fmt, ...) \ - pr_debug("GPIO chip %s: " fmt, chip->label, ##__VA_ARGS__) + dev_dbg(&chip->gpiodev->dev, "(%s): " fmt, chip->label, ##__VA_ARGS__) #ifdef CONFIG_GPIO_SYSFS