aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-12-15 17:50:45 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-01-24 19:24:21 -0500
commitf9492fda70c87b410e61675095212dc806bdf615 (patch)
treec93658fb54a61a70e0f612345abe59cbb72c7de9 /drivers/sh
parentf9165132c5ee681235068857e4f86c7ecc5a4617 (diff)
sh-pfc: Merge PFC core and pinctrl
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 <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/pfc/Kconfig10
-rw-r--r--drivers/sh/pfc/Makefile4
-rw-r--r--drivers/sh/pfc/core.c15
-rw-r--r--drivers/sh/pfc/pinctrl.c3
4 files changed, 7 insertions, 25 deletions
diff --git a/drivers/sh/pfc/Kconfig b/drivers/sh/pfc/Kconfig
index 804f9ad1bf4a..f33d82a38b4b 100644
--- a/drivers/sh/pfc/Kconfig
+++ b/drivers/sh/pfc/Kconfig
@@ -5,18 +5,10 @@ config SH_PFC
5 depends on GENERIC_GPIO 5 depends on GENERIC_GPIO
6 select GPIO_SH_PFC if ARCH_REQUIRE_GPIOLIB 6 select GPIO_SH_PFC if ARCH_REQUIRE_GPIOLIB
7 select PINCTRL_SH_PFC 7 select PINCTRL_SH_PFC
8 def_bool y
9
10#
11# Placeholder for now, rehome to drivers/pinctrl once the PFC APIs
12# have settled.
13#
14config PINCTRL_SH_PFC
15 tristate "SuperH PFC pin controller driver"
16 depends on SH_PFC
17 select PINCTRL 8 select PINCTRL
18 select PINMUX 9 select PINMUX
19 select PINCONF 10 select PINCONF
11 def_bool y
20 12
21config GPIO_SH_PFC 13config GPIO_SH_PFC
22 tristate "SuperH PFC GPIO support" 14 tristate "SuperH PFC GPIO support"
diff --git a/drivers/sh/pfc/Makefile b/drivers/sh/pfc/Makefile
index 7916027cce37..ce6fae353844 100644
--- a/drivers/sh/pfc/Makefile
+++ b/drivers/sh/pfc/Makefile
@@ -1,3 +1,3 @@
1obj-y += core.o 1sh-pfc-objs = core.o pinctrl.o
2obj-$(CONFIG_PINCTRL_SH_PFC) += pinctrl.o 2obj-y += sh-pfc.o
3obj-$(CONFIG_GPIO_SH_PFC) += gpio.o 3obj-$(CONFIG_GPIO_SH_PFC) += gpio.o
diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c
index 72421a4a883d..30e33db7a2dc 100644
--- a/drivers/sh/pfc/core.c
+++ b/drivers/sh/pfc/core.c
@@ -8,7 +8,7 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 */ 10 */
11#define pr_fmt(fmt) "sh_pfc " KBUILD_MODNAME ": " fmt 11#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12 12
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
@@ -497,7 +497,6 @@ int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
497 out_err: 497 out_err:
498 return -1; 498 return -1;
499} 499}
500EXPORT_SYMBOL_GPL(sh_pfc_config_gpio);
501 500
502int register_sh_pfc(struct sh_pfc_platform_data *pdata) 501int register_sh_pfc(struct sh_pfc_platform_data *pdata)
503{ 502{
@@ -528,17 +527,9 @@ int register_sh_pfc(struct sh_pfc_platform_data *pdata)
528 /* 527 /*
529 * Initialize pinctrl bindings first 528 * Initialize pinctrl bindings first
530 */ 529 */
531 initroutine = symbol_request(sh_pfc_register_pinctrl); 530 ret = sh_pfc_register_pinctrl(&sh_pfc);
532 if (initroutine) { 531 if (unlikely(ret != 0))
533 ret = (*initroutine)(&sh_pfc);
534 symbol_put_addr(initroutine);
535
536 if (unlikely(ret != 0))
537 goto err;
538 } else {
539 pr_err("failed to initialize pinctrl bindings\n");
540 goto err; 532 goto err;
541 }
542 533
543 /* 534 /*
544 * Then the GPIO chip 535 * Then the GPIO chip
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c
index 5801a5686148..6f0f58bd3f87 100644
--- a/drivers/sh/pfc/pinctrl.c
+++ b/drivers/sh/pfc/pinctrl.c
@@ -9,7 +9,7 @@
9 */ 9 */
10#define DRV_NAME "pinctrl-sh_pfc" 10#define DRV_NAME "pinctrl-sh_pfc"
11 11
12#define pr_fmt(fmt) DRV_NAME " " KBUILD_MODNAME ": " fmt 12#define pr_fmt(fmt) KBUILD_MODNAME " pinctrl: " fmt
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/module.h> 15#include <linux/module.h>
@@ -521,7 +521,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
521 521
522 return sh_pfc_pinctrl_init(); 522 return sh_pfc_pinctrl_init();
523} 523}
524EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl);
525 524
526static void __exit sh_pfc_pinctrl_exit(void) 525static void __exit sh_pfc_pinctrl_exit(void)
527{ 526{