From patchwork Wed Aug 14 16:25:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19154 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B832246B8 for ; Wed, 14 Aug 2013 16:25:41 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id m1sf7051494ves.2 for ; Wed, 14 Aug 2013 09:25:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=SG5xMt+uMdThOM5GISiR1ASb1nfvrdi1j6AuTzQ8zcI=; b=MyiZnOCu7T5p07Rb5nDbAW7Tjrr4m/RfaApWdUQntizGct3XA8jol5TvtcA+SaUcio nomolQr5o2B9a+TtKhepSGSe3RcrrFg+ZvIbquWjkNd5Hn3SGGKuBwkQhVVKMA8zgGbX GPT8VMWWSFJxtiF5K783hMiGfCITU3CE4rObPXk27RHRW5Msm8DFW7ZEmOKPcCQl5m2S m8AciDgIPbLgs8orwxBxgswDNxRB8pHJEo7rEKxkZhp4IGovVT4978zpA/43D2GTRCh5 avrrtRGOIsGhtnZ4UbY4/EHgqg5A+dl4W/z0fgfKCz9uH/KqcNqoWOb/xX+eD92DnnSv gA0w== X-Received: by 10.58.118.201 with SMTP id ko9mr2834542veb.8.1376497541075; Wed, 14 Aug 2013 09:25:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.9 with SMTP id kq9ls3360612qeb.48.gmail; Wed, 14 Aug 2013 09:25:41 -0700 (PDT) X-Received: by 10.58.217.167 with SMTP id oz7mr10300826vec.15.1376497540984; Wed, 14 Aug 2013 09:25:40 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id ur15si11280580veb.70.2013.08.14.09.25.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 09:25:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id 15so7963009vea.29 for ; Wed, 14 Aug 2013 09:25:40 -0700 (PDT) X-Gm-Message-State: ALoCoQn7yGlfxiDXN255ONf7C3NEhsV+WPEei86mDM0RAEGlIJn0BQen5gLGVZB8G1UhXg6afjzo X-Received: by 10.52.75.162 with SMTP id d2mr6178vdw.86.1376497540868; Wed, 14 Aug 2013 09:25:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp221735vcz; Wed, 14 Aug 2013 09:25:40 -0700 (PDT) X-Received: by 10.152.25.135 with SMTP id c7mr2231507lag.39.1376497539359; Wed, 14 Aug 2013 09:25:39 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id ds1si8417406lac.136.2013.08.14.09.25.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 09:25:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id el20so4377046lab.12 for ; Wed, 14 Aug 2013 09:25:38 -0700 (PDT) X-Received: by 10.112.50.72 with SMTP id a8mr1043272lbo.50.1376497538621; Wed, 14 Aug 2013 09:25:38 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-76.bredband.comhem.se. [83.249.208.76]) by mx.google.com with ESMTPSA id w5sm15780934lbw.3.2013.08.14.09.25.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 14 Aug 2013 09:25:37 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Stephen Warren , Linus Walleij , Sonic Zhang Subject: [PATCH] pinctrl: improve warning messages Date: Wed, 14 Aug 2013 18:25:33 +0200 Message-Id: <1376497533-32303-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Print out the affected group name on activation of pin mux settings, and warn if you cannot free a pin that should have been part of a certain setting. Cc: Sonic Zhang Signed-off-by: Linus Walleij --- drivers/pinctrl/pinmux.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 5f51588..008f965 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -400,10 +400,14 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting) ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, &pins, &num_pins); if (ret) { + const char *gname; + /* errors only affect debug data, so just warn */ + gname = pctlops->get_group_name(pctldev, + setting->data.mux.group); dev_warn(pctldev->dev, - "could not get pins for group selector %d\n", - setting->data.mux.group); + "could not get pins for group %s\n", + gname); num_pins = 0; } @@ -411,9 +415,14 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting) for (i = 0; i < num_pins; i++) { ret = pin_request(pctldev, pins[i], setting->dev_name, NULL); if (ret) { + const char *gname; + + gname = pctlops->get_group_name(pctldev, + setting->data.mux.group); dev_err(pctldev->dev, - "could not request pin %d on device %s\n", - pins[i], pinctrl_dev_get_name(pctldev)); + "could not request pin %d from group %s on " + "device %s\n", + pins[i], gname, pinctrl_dev_get_name(pctldev)); goto err_pin_request; } } @@ -466,10 +475,14 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting) ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, &pins, &num_pins); if (ret) { + const char *gname; + /* errors only affect debug data, so just warn */ + gname = pctlops->get_group_name(pctldev, + setting->data.mux.group); dev_warn(pctldev->dev, - "could not get pins for group selector %d\n", - setting->data.mux.group); + "could not get pins for group %s\n", + gname); num_pins = 0; } @@ -486,6 +499,16 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting) desc->mux_setting = NULL; /* And release the pin */ pin_free(pctldev, pins[i], NULL); + } else { + const char *gname; + + gname = pctlops->get_group_name(pctldev, + setting->data.mux.group); + dev_warn(pctldev->dev, + "not freeing pin %d as part of deactivating " + "group %s - it is already used for some other " + "setting", + pins[i], gname); } }