From patchwork Fri Jan 18 07:31:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 1999691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 9152D3FD86 for ; Fri, 18 Jan 2013 07:34:30 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tw6Qp-0005fm-8j; Fri, 18 Jan 2013 07:32:07 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tw6QN-0005aC-G7 for linux-arm-kernel@lists.infradead.org; Fri, 18 Jan 2013 07:31:40 +0000 Received: by mail-pa0-f50.google.com with SMTP id hz10so1971657pad.9 for ; Thu, 17 Jan 2013 23:31:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=Mx/fNtdaqPRih30au/esnyWq19JpOwl8HxnDM2Idq+s=; b=JlOWzqf+EbeMO9+yQfxlOK5Dl1q/dkPP7WnuZGp0ljiaWAMhzfz/lgAX+6Q4yjB5Cn 5yXs2hNZQBZU+a0/QNFG/mYfPEVmvq/N3SO30gG+7lXqLnys80tPuMZ+wADuSC7mxECR wzpKWxoDwgwqzaoCxH4a9SzWdRa3uP93QbVbnmrDKYFZ0Vvl4G874dhUNEXmLJYntGNP OYR3artHKhOLuV3Oi4CB3h2o+y66Zg9d9z2cPAZ4uG7+SMu9hU43XaEF2vv5tnYJs+ei vXG6DMviPOAYgiq0u6D9WmhLSb66yONdWSUeb6UvFhTOfYfx5kmwwZz7R6OfRmx1L4XN hBXw== X-Received: by 10.68.229.194 with SMTP id ss2mr2585966pbc.17.1358494298085; Thu, 17 Jan 2013 23:31:38 -0800 (PST) Received: from localhost.localdomain ([98.126.173.75]) by mx.google.com with ESMTPS id i6sm2922899paw.19.2013.01.17.23.31.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 23:31:37 -0800 (PST) From: Haojian Zhuang To: linus.walleij@linaro.org, linux@arm.linux.org.uk, tony@atomide.com, linux-arm-kernel@lists.infradead.org, swarren@nvidia.com Subject: [PATCH v7 02/15] pinctrl: core: get devname from pinctrl_dev Date: Fri, 18 Jan 2013 15:31:06 +0800 Message-Id: <1358494279-16503-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358494279-16503-1-git-send-email-haojian.zhuang@linaro.org> References: <1358494279-16503-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQkEbfP4kdZwCVbOhea8OUMn9vVI+dojpS7hdeMkBaNU7uti5/7Nvwox4a450oWM+snBHiQA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130118_023139_663213_153C1C36 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.50 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add new function to get devname from pinctrl_dev. pinctrl_dev_get_name() can only get pinctrl description name. If we want to use gpio driver to find pinctrl device node, we need to fetch the pinctrl device name. Signed-off-by: Haojian Zhuang --- drivers/pinctrl/core.c | 6 ++++++ include/linux/pinctrl/pinctrl.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 59f5a96..e7378a1 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -83,6 +83,12 @@ const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev) } EXPORT_SYMBOL_GPL(pinctrl_dev_get_name); +const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev) +{ + return dev_name(pctldev->dev); +} +EXPORT_SYMBOL_GPL(pinctrl_dev_get_devname); + void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev) { return pctldev->driver_data; diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 04d6700..778804d 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -154,6 +154,7 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) #endif /* CONFIG_OF */ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); +extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); #else