From patchwork Sat Dec 15 22:50:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1883491 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 98A4DDF2EF for ; Sat, 15 Dec 2012 22:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127Ab2LOWuy (ORCPT ); Sat, 15 Dec 2012 17:50:54 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:40097 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404Ab2LOWux (ORCPT ); Sat, 15 Dec 2012 17:50:53 -0500 Received: from avalon.quadriga.com (unknown [194.136.87.226]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2D21335A69; Sat, 15 Dec 2012 23:50:52 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Cc: Paul Mundt , Magnus Damm , Simon Horman , Linus Walleij , Kuninori Morimoto , Phil Edworthy , Nobuhiro Iwamatsu Subject: [PATCH v3 11/81] sh-pfc: Merge PFC core and pinctrl Date: Sat, 15 Dec 2012 23:50:45 +0100 Message-Id: <1355611915-25060-12-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1355611915-25060-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1355611915-25060-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org The PFC core is only used by the pinctrl and gpio modules. As the gpio module depends on the pinctrl module, the pinctrl module will always be present if the core gets used. There is thus no point in keeping core and pinctrl in two seperate modules. Merge them. Signed-off-by: Laurent Pinchart Acked-by: Paul Mundt --- drivers/sh/pfc/Kconfig | 10 +--------- drivers/sh/pfc/Makefile | 4 ++-- drivers/sh/pfc/core.c | 15 +++------------ drivers/sh/pfc/pinctrl.c | 3 +-- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/drivers/sh/pfc/Kconfig b/drivers/sh/pfc/Kconfig index 804f9ad..f33d82a 100644 --- a/drivers/sh/pfc/Kconfig +++ b/drivers/sh/pfc/Kconfig @@ -5,18 +5,10 @@ config SH_PFC depends on GENERIC_GPIO select GPIO_SH_PFC if ARCH_REQUIRE_GPIOLIB select PINCTRL_SH_PFC - def_bool y - -# -# Placeholder for now, rehome to drivers/pinctrl once the PFC APIs -# have settled. -# -config PINCTRL_SH_PFC - tristate "SuperH PFC pin controller driver" - depends on SH_PFC select PINCTRL select PINMUX select PINCONF + def_bool y config GPIO_SH_PFC tristate "SuperH PFC GPIO support" diff --git a/drivers/sh/pfc/Makefile b/drivers/sh/pfc/Makefile index 7916027..ce6fae3 100644 --- a/drivers/sh/pfc/Makefile +++ b/drivers/sh/pfc/Makefile @@ -1,3 +1,3 @@ -obj-y += core.o -obj-$(CONFIG_PINCTRL_SH_PFC) += pinctrl.o +sh-pfc-objs = core.o pinctrl.o +obj-y += sh-pfc.o obj-$(CONFIG_GPIO_SH_PFC) += gpio.o diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c index 72421a4..30e33db 100644 --- a/drivers/sh/pfc/core.c +++ b/drivers/sh/pfc/core.c @@ -8,7 +8,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ -#define pr_fmt(fmt) "sh_pfc " KBUILD_MODNAME ": " fmt +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include @@ -497,7 +497,6 @@ int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, out_err: return -1; } -EXPORT_SYMBOL_GPL(sh_pfc_config_gpio); int register_sh_pfc(struct sh_pfc_platform_data *pdata) { @@ -528,17 +527,9 @@ int register_sh_pfc(struct sh_pfc_platform_data *pdata) /* * Initialize pinctrl bindings first */ - initroutine = symbol_request(sh_pfc_register_pinctrl); - if (initroutine) { - ret = (*initroutine)(&sh_pfc); - symbol_put_addr(initroutine); - - if (unlikely(ret != 0)) - goto err; - } else { - pr_err("failed to initialize pinctrl bindings\n"); + ret = sh_pfc_register_pinctrl(&sh_pfc); + if (unlikely(ret != 0)) goto err; - } /* * Then the GPIO chip diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c index 5801a56..6f0f58b 100644 --- a/drivers/sh/pfc/pinctrl.c +++ b/drivers/sh/pfc/pinctrl.c @@ -9,7 +9,7 @@ */ #define DRV_NAME "pinctrl-sh_pfc" -#define pr_fmt(fmt) DRV_NAME " " KBUILD_MODNAME ": " fmt +#define pr_fmt(fmt) KBUILD_MODNAME " pinctrl: " fmt #include #include @@ -521,7 +521,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc) return sh_pfc_pinctrl_init(); } -EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); static void __exit sh_pfc_pinctrl_exit(void) {