diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-tb10x.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-tb10x.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index 3b9bfcf717a..160a1f5e989 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); @@ -847,7 +843,6 @@ static struct platform_driver tb10x_pinctrl_pdrv = { .driver = { .name = "tb10x_pinctrl", .of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids), - .owner = THIS_MODULE } }; |