OSDN Git Service

pinctrl: vt8500: Delete an error message for a failed memory allocation in five functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 28 Dec 2017 15:12:17 +0000 (16:12 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 8 Jan 2018 07:15:46 +0000 (08:15 +0100)
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>
drivers/pinctrl/vt8500/pinctrl-vt8500.c
drivers/pinctrl/vt8500/pinctrl-wm8505.c
drivers/pinctrl/vt8500/pinctrl-wm8650.c
drivers/pinctrl/vt8500/pinctrl-wm8750.c
drivers/pinctrl/vt8500/pinctrl-wm8850.c

index 767f340..9086a37 100644 (file)
@@ -458,10 +458,8 @@ static int vt8500_pinctrl_probe(struct platform_device *pdev)
        struct wmt_pinctrl_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "failed to allocate data\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        data->banks = vt8500_banks;
        data->nbanks = ARRAY_SIZE(vt8500_banks);
index a56fdbd..e1aae1d 100644 (file)
@@ -489,10 +489,8 @@ static int wm8505_pinctrl_probe(struct platform_device *pdev)
        struct wmt_pinctrl_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "failed to allocate data\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        data->banks = wm8505_banks;
        data->nbanks = ARRAY_SIZE(wm8505_banks);
index 270dd49..4678227 100644 (file)
@@ -327,10 +327,8 @@ static int wm8650_pinctrl_probe(struct platform_device *pdev)
        struct wmt_pinctrl_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "failed to allocate data\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        data->banks = wm8650_banks;
        data->nbanks = ARRAY_SIZE(wm8650_banks);
index 74f7b3a..c46d694 100644 (file)
@@ -366,10 +366,8 @@ static int wm8750_pinctrl_probe(struct platform_device *pdev)
        struct wmt_pinctrl_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "failed to allocate data\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        data->banks = wm8750_banks;
        data->nbanks = ARRAY_SIZE(wm8750_banks);
index 45792aa..e2e8531 100644 (file)
@@ -345,10 +345,8 @@ static int wm8850_pinctrl_probe(struct platform_device *pdev)
        struct wmt_pinctrl_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "failed to allocate data\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        data->banks = wm8850_banks;
        data->nbanks = ARRAY_SIZE(wm8850_banks);