aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/pfc/pinctrl.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c
index 814b29255aef..2804eaae804e 100644
--- a/drivers/sh/pfc/pinctrl.c
+++ b/drivers/sh/pfc/pinctrl.c
@@ -325,20 +325,6 @@ static struct pinctrl_desc sh_pfc_pinctrl_desc = {
325 .confops = &sh_pfc_pinconf_ops, 325 .confops = &sh_pfc_pinconf_ops,
326}; 326};
327 327
328int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
329{
330 sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL);
331 if (unlikely(!sh_pfc_pmx))
332 return -ENOMEM;
333
334 spin_lock_init(&sh_pfc_pmx->lock);
335
336 sh_pfc_pmx->pfc = pfc;
337
338 return 0;
339}
340EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl);
341
342static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, 328static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc,
343 struct sh_pfc_pinctrl *pmx, 329 struct sh_pfc_pinctrl *pmx,
344 struct pinmux_gpio *gpio, 330 struct pinmux_gpio *gpio,
@@ -505,7 +491,7 @@ static struct platform_device sh_pfc_pinctrl_device = {
505 .id = -1, 491 .id = -1,
506}; 492};
507 493
508static int __init sh_pfc_pinctrl_init(void) 494static int sh_pfc_pinctrl_init(void)
509{ 495{
510 int rc; 496 int rc;
511 497
@@ -519,10 +505,22 @@ static int __init sh_pfc_pinctrl_init(void)
519 return rc; 505 return rc;
520} 506}
521 507
508int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
509{
510 sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL);
511 if (unlikely(!sh_pfc_pmx))
512 return -ENOMEM;
513
514 spin_lock_init(&sh_pfc_pmx->lock);
515
516 sh_pfc_pmx->pfc = pfc;
517
518 return sh_pfc_pinctrl_init();
519}
520EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl);
521
522static void __exit sh_pfc_pinctrl_exit(void) 522static void __exit sh_pfc_pinctrl_exit(void)
523{ 523{
524 platform_driver_unregister(&sh_pfc_pinctrl_driver); 524 platform_driver_unregister(&sh_pfc_pinctrl_driver);
525} 525}
526
527subsys_initcall(sh_pfc_pinctrl_init);
528module_exit(sh_pfc_pinctrl_exit); 526module_exit(sh_pfc_pinctrl_exit);