summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/pinctrl/pinctrl-tb10x.c9
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)
mutex_init(&state->mutex);
state->base = devm_ioremap_resource(dev, mem);
- if (!state->base) {
- dev_err(dev, "Request register region failed.\n");
- ret = -EBUSY;
+ if (IS_ERR(state->base)) {
+ ret = PTR_ERR(state->base);
goto fail;
}
@@ -830,9 +829,9 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev)
}
state->pctl = pinctrl_register(&tb10x_pindesc, dev, state);
- if (IS_ERR(state->pctl)) {
+ if (!state->pctl) {
dev_err(dev, "could not register TB10x pin driver\n");
- ret = PTR_ERR(state->pctl);
+ ret = -EINVAL;
goto fail;
}