提交 aa2c35e5 编写于 作者: V Varka Bhadram 提交者: Linus Walleij

pinctrl-tb10x: remove duplicate check on resource

Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: NVarka Bhadram <varkab@cdac.in>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 eec45071
...@@ -759,7 +759,7 @@ static struct pinctrl_desc tb10x_pindesc = { ...@@ -759,7 +759,7 @@ static struct pinctrl_desc tb10x_pindesc = {
static int tb10x_pinctrl_probe(struct platform_device *pdev) static int tb10x_pinctrl_probe(struct platform_device *pdev)
{ {
int ret = -EINVAL; int ret = -EINVAL;
struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *mem;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *of_node = dev->of_node; struct device_node *of_node = dev->of_node;
struct device_node *child; struct device_node *child;
...@@ -771,11 +771,6 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) ...@@ -771,11 +771,6 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
if (!mem) {
dev_err(dev, "No memory resource defined.\n");
return -EINVAL;
}
state = devm_kzalloc(dev, sizeof(struct tb10x_pinctrl) + state = devm_kzalloc(dev, sizeof(struct tb10x_pinctrl) +
of_get_child_count(of_node) of_get_child_count(of_node)
* sizeof(struct tb10x_of_pinfunc), * sizeof(struct tb10x_of_pinfunc),
...@@ -787,6 +782,7 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) ...@@ -787,6 +782,7 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev)
state->pinfuncs = (struct tb10x_of_pinfunc *)(state + 1); state->pinfuncs = (struct tb10x_of_pinfunc *)(state + 1);
mutex_init(&state->mutex); mutex_init(&state->mutex);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
state->base = devm_ioremap_resource(dev, mem); state->base = devm_ioremap_resource(dev, mem);
if (IS_ERR(state->base)) { if (IS_ERR(state->base)) {
ret = PTR_ERR(state->base); ret = PTR_ERR(state->base);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册