summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-06-16 23:43:16 +0530
committerLinus Walleij <linus.walleij@linaro.org>2012-07-03 21:51:07 +0200
commitda9aecb02d8763ef17130dfd7c678747ad84b070 (patch)
treee286ce230caabbbb09cfcac6669b87cdca899cb9
parent7e1dfe5319de9ab8c73f3934da4debd0fd88c71c (diff)
pinctrl/pinctrl-core: cleanup pinctrl_register
lots of places the ret is used just for non zero cases with out that also we can check the status of the function calls. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/core.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 0cc053af70b..50d9c289cff 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1395,9 +1395,9 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
struct pinctrl_dev *pctldev;
int ret;
- if (pctldesc == NULL)
+ if (!pctldesc)
return NULL;
- if (pctldesc->name == NULL)
+ if (!pctldesc->name)
return NULL;
pctldev = kzalloc(sizeof(*pctldev), GFP_KERNEL);
@@ -1415,23 +1415,20 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
pctldev->dev = dev;
/* check core ops for sanity */
- ret = pinctrl_check_ops(pctldev);
- if (ret) {
+ if (pinctrl_check_ops(pctldev)) {
dev_err(dev, "pinctrl ops lacks necessary functions\n");
goto out_err;
}
/* If we're implementing pinmuxing, check the ops for sanity */
if (pctldesc->pmxops) {
- ret = pinmux_check_ops(pctldev);
- if (ret)
+ if (pinmux_check_ops(pctldev))
goto out_err;
}
/* If we're implementing pinconfig, check the ops for sanity */
if (pctldesc->confops) {
- ret = pinconf_check_ops(pctldev);
- if (ret)
+ if (pinconf_check_ops(pctldev))
goto out_err;
}
@@ -1457,11 +1454,9 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
if (IS_ERR(s)) {
dev_dbg(dev, "failed to lookup the default state\n");
} else {
- ret = pinctrl_select_state_locked(pctldev->p, s);
- if (ret) {
+ if (pinctrl_select_state_locked(pctldev->p, s))
dev_err(dev,
"failed to select default state\n");
- }
}
}