diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-10-20 22:55:29 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-10-23 04:41:22 -0400 |
commit | 86467ff2ddca94c0d8d10b92b5916e68c0cad8a9 (patch) | |
tree | 7a54fc2c24f30699fb4b691025bc7defd6a52870 /drivers/pinctrl | |
parent | fe61052ae97a33c229a3ae7ad29e0c9b9ccada02 (diff) |
pinctrl: tb10x: fix the error handling in tb10x_pinctrl_probe()
This patch fix the error handling in tb10x_pinctrl_probe():
- devm_ioremap_resource() return ERR_PTR() and never return NULL
- remove the dev_err call to avoid redundant error message
- pinctrl_register() returns NULL not ERR_PTR()
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-tb10x.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index 2e1ea568c9a2..9f7fa9b6ea80 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c | |||
@@ -806,9 +806,8 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) | |||
806 | mutex_init(&state->mutex); | 806 | mutex_init(&state->mutex); |
807 | 807 | ||
808 | state->base = devm_ioremap_resource(dev, mem); | 808 | state->base = devm_ioremap_resource(dev, mem); |
809 | if (!state->base) { | 809 | if (IS_ERR(state->base)) { |
810 | dev_err(dev, "Request register region failed.\n"); | 810 | ret = PTR_ERR(state->base); |
811 | ret = -EBUSY; | ||
812 | goto fail; | 811 | goto fail; |
813 | } | 812 | } |
814 | 813 | ||
@@ -830,9 +829,9 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) | |||
830 | } | 829 | } |
831 | 830 | ||
832 | state->pctl = pinctrl_register(&tb10x_pindesc, dev, state); | 831 | state->pctl = pinctrl_register(&tb10x_pindesc, dev, state); |
833 | if (IS_ERR(state->pctl)) { | 832 | if (!state->pctl) { |
834 | dev_err(dev, "could not register TB10x pin driver\n"); | 833 | dev_err(dev, "could not register TB10x pin driver\n"); |
835 | ret = PTR_ERR(state->pctl); | 834 | ret = -EINVAL; |
836 | goto fail; | 835 | goto fail; |
837 | } | 836 | } |
838 | 837 | ||