diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2014-10-21 14:36:59 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-10-28 17:15:20 +0100 |
commit | aa2c35e5a66194f36578345a23708851935bdff6 (patch) | |
tree | 46971d3ed2c7d68d8fb2d8c501c4f83b48b52155 /drivers/pinctrl | |
parent | eec450713e5c5cafa9b8565c84548580080b1f64 (diff) | |
download | op-kernel-dev-aa2c35e5a66194f36578345a23708851935bdff6.zip op-kernel-dev-aa2c35e5a66194f36578345a23708851935bdff6.tar.gz |
pinctrl-tb10x: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-tb10x.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index 3b9bfcf..9363563 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c @@ -759,7 +759,7 @@ static struct pinctrl_desc tb10x_pindesc = { static int tb10x_pinctrl_probe(struct platform_device *pdev) { int ret = -EINVAL; - struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + struct resource *mem; struct device *dev = &pdev->dev; struct device_node *of_node = dev->of_node; struct device_node *child; @@ -771,11 +771,6 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) return -EINVAL; } - if (!mem) { - dev_err(dev, "No memory resource defined.\n"); - return -EINVAL; - } - state = devm_kzalloc(dev, sizeof(struct tb10x_pinctrl) + of_get_child_count(of_node) * sizeof(struct tb10x_of_pinfunc), @@ -787,6 +782,7 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) state->pinfuncs = (struct tb10x_of_pinfunc *)(state + 1); mutex_init(&state->mutex); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); state->base = devm_ioremap_resource(dev, mem); if (IS_ERR(state->base)) { ret = PTR_ERR(state->base); |