|
@@ -372,6 +372,12 @@ static int sh_pfc_probe(struct platform_device *pdev)
|
|
|
|
|
|
spin_lock_init(&pfc->lock);
|
|
|
|
|
|
+ if (info->ops && info->ops->init) {
|
|
|
+ ret = info->ops->init(pfc);
|
|
|
+ if (ret < 0)
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
pinctrl_provide_dummies();
|
|
|
|
|
|
/*
|
|
@@ -379,7 +385,7 @@ static int sh_pfc_probe(struct platform_device *pdev)
|
|
|
*/
|
|
|
ret = sh_pfc_register_pinctrl(pfc);
|
|
|
if (unlikely(ret != 0))
|
|
|
- return ret;
|
|
|
+ goto error;
|
|
|
|
|
|
#ifdef CONFIG_GPIO_SH_PFC
|
|
|
/*
|
|
@@ -401,6 +407,11 @@ static int sh_pfc_probe(struct platform_device *pdev)
|
|
|
dev_info(pfc->dev, "%s support registered\n", info->name);
|
|
|
|
|
|
return 0;
|
|
|
+
|
|
|
+error:
|
|
|
+ if (info->ops && info->ops->exit)
|
|
|
+ info->ops->exit(pfc);
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static int sh_pfc_remove(struct platform_device *pdev)
|
|
@@ -412,6 +423,9 @@ static int sh_pfc_remove(struct platform_device *pdev)
|
|
|
#endif
|
|
|
sh_pfc_unregister_pinctrl(pfc);
|
|
|
|
|
|
+ if (pfc->info->ops && pfc->info->ops->exit)
|
|
|
+ pfc->info->ops->exit(pfc);
|
|
|
+
|
|
|
platform_set_drvdata(pdev, NULL);
|
|
|
|
|
|
return 0;
|