Browse Source

pinctrl: tz1090: Delete an error message for a failed memory allocation in two functions

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Markus Elfring 7 years ago
parent
commit
8c017679ab
1 changed files with 3 additions and 6 deletions
  1. 3 6
      drivers/pinctrl/pinctrl-tz1090.c

+ 3 - 6
drivers/pinctrl/pinctrl-tz1090.c

@@ -1082,10 +1082,8 @@ static int add_map_configs(struct device *dev,
 
 
 	dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
 	dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
 			      GFP_KERNEL);
 			      GFP_KERNEL);
-	if (!dup_configs) {
-		dev_err(dev, "kmemdup(configs) failed\n");
+	if (!dup_configs)
 		return -ENOMEM;
 		return -ENOMEM;
-	}
 
 
 	(*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
 	(*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
 	(*map)[*num_maps].data.configs.group_or_pin = group;
 	(*map)[*num_maps].data.configs.group_or_pin = group;
@@ -1946,10 +1944,9 @@ static int tz1090_pinctrl_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct resource *res;
 
 
 	pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
 	pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
-	if (!pmx) {
-		dev_err(&pdev->dev, "Can't alloc tz1090_pmx\n");
+	if (!pmx)
 		return -ENOMEM;
 		return -ENOMEM;
-	}
+
 	pmx->dev = &pdev->dev;
 	pmx->dev = &pdev->dev;
 	spin_lock_init(&pmx->lock);
 	spin_lock_init(&pmx->lock);