diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-12-15 23:50:46 +0100 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-01-25 09:24:21 +0900 |
commit | 6f6a4a683be97837f3baae443aacd2b0e6162b10 (patch) | |
tree | f1a3970e00dfd46df21769c11c7d795ebd192c25 /drivers/sh/pfc/core.c | |
parent | f9492fda70c87b410e61675095212dc806bdf615 (diff) | |
download | linux-6f6a4a683be97837f3baae443aacd2b0e6162b10.tar.bz2 |
sh-pfc: Merge PFC core and gpio
The PFC core calls the gpio module gpiochip registration in its
register_sh_pfc() function, itself called at arch initialization time.
If the gpio module isn't present then the gpiochip will never be
registered.
As the gpio module can only be present at arch initialization time if
it's builtin, there's no point in allowing to build it as a module. Make
it a boolean option, and initialize it synchronously with the core if
selected.
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/pfc/core.c')
-rw-r--r-- | drivers/sh/pfc/core.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c index 30e33db7a2dc..541099613a21 100644 --- a/drivers/sh/pfc/core.c +++ b/drivers/sh/pfc/core.c @@ -149,7 +149,6 @@ int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos) return (gpio_read_raw_reg(dr->mapped_reg, dr->reg_width) >> pos) & 1; } -EXPORT_SYMBOL_GPL(sh_pfc_read_bit); void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, unsigned long value) @@ -169,7 +168,6 @@ void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, gpio_write_raw_reg(dr->mapped_reg, dr->reg_width, dr->reg_shadow); } -EXPORT_SYMBOL_GPL(sh_pfc_write_bit); static void config_reg_helper(struct sh_pfc *pfc, struct pinmux_cfg_reg *crp, @@ -307,7 +305,6 @@ int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio, *bitp = n; return 0; } -EXPORT_SYMBOL_GPL(sh_pfc_get_data_reg); static int get_config_reg(struct sh_pfc *pfc, pinmux_enum_t enum_id, struct pinmux_cfg_reg **crp, @@ -384,7 +381,6 @@ int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos, pr_err("cannot locate data/mark enum_id for gpio %d\n", gpio); return -1; } -EXPORT_SYMBOL_GPL(sh_pfc_gpio_to_enum); int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, int cfg_mode) @@ -500,7 +496,6 @@ int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, int register_sh_pfc(struct sh_pfc_platform_data *pdata) { - int (*initroutine)(struct sh_pfc *) = NULL; int ret; /* @@ -531,24 +526,20 @@ int register_sh_pfc(struct sh_pfc_platform_data *pdata) if (unlikely(ret != 0)) goto err; +#ifdef CONFIG_GPIO_SH_PFC /* * Then the GPIO chip */ - initroutine = symbol_request(sh_pfc_register_gpiochip); - if (initroutine) { - ret = (*initroutine)(&sh_pfc); - symbol_put_addr(initroutine); - + ret = sh_pfc_register_gpiochip(&sh_pfc); + if (unlikely(ret != 0)) { /* * If the GPIO chip fails to come up we still leave the * PFC state as it is, given that there are already * extant users of it that have succeeded by this point. */ - if (unlikely(ret != 0)) { - pr_notice("failed to init GPIO chip, ignoring...\n"); - ret = 0; - } + pr_notice("failed to init GPIO chip, ignoring...\n"); } +#endif pr_info("%s support registered\n", sh_pfc.pdata->name); @@ -560,3 +551,7 @@ err: return ret; } + +MODULE_AUTHOR("Magnus Damm, Paul Mundt, Laurent Pinchart"); +MODULE_DESCRIPTION("Pin Control and GPIO driver for SuperH pin function controller"); +MODULE_LICENSE("GPL v2"); |