diff options
Diffstat (limited to 'drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c')
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c index b896f7ba606e..8fcba48e0a42 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/pinctrl/pinctrl.h> | 19 | #include <linux/pinctrl/pinctrl.h> |
20 | #include <linux/reset.h> | ||
20 | 21 | ||
21 | #include "pinctrl-sunxi.h" | 22 | #include "pinctrl-sunxi.h" |
22 | 23 | ||
@@ -96,8 +97,26 @@ static const struct sunxi_pinctrl_desc sun6i_a31_r_pinctrl_data = { | |||
96 | 97 | ||
97 | static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev) | 98 | static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev) |
98 | { | 99 | { |
99 | return sunxi_pinctrl_init(pdev, | 100 | struct reset_control *rstc; |
100 | &sun6i_a31_r_pinctrl_data); | 101 | int ret; |
102 | |||
103 | rstc = devm_reset_control_get(&pdev->dev, NULL); | ||
104 | if (IS_ERR(rstc)) { | ||
105 | dev_err(&pdev->dev, "Reset controller missing\n"); | ||
106 | return PTR_ERR(rstc); | ||
107 | } | ||
108 | |||
109 | ret = reset_control_deassert(rstc); | ||
110 | if (ret) | ||
111 | return ret; | ||
112 | |||
113 | ret = sunxi_pinctrl_init(pdev, | ||
114 | &sun6i_a31_r_pinctrl_data); | ||
115 | |||
116 | if (ret) | ||
117 | reset_control_assert(rstc); | ||
118 | |||
119 | return ret; | ||
101 | } | 120 | } |
102 | 121 | ||
103 | static struct of_device_id sun6i_a31_r_pinctrl_match[] = { | 122 | static struct of_device_id sun6i_a31_r_pinctrl_match[] = { |