i2c-mux-reg: Delete an error message for a failed memory allocation in i2c_mux_reg_probe_dt()

Message ID 224a8918-f882-9ab1-218c-83df93d4cb2f@users.sourceforge.net
State New
Delegated to: Peter Rosin
Headers show
Series
  • i2c-mux-reg: Delete an error message for a failed memory allocation in i2c_mux_reg_probe_dt()
Related show

Commit Message

SF Markus Elfring Feb. 1, 2018, 4:24 p.m.
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 1 Feb 2018 17:17:19 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Alexander Sverdlin Feb. 1, 2018, 4:46 p.m. | #1
On 01/02/18 17:24, SF Markus Elfring wrote:
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

> ---
>  drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
> index c948e5a4cb04..f624ed64a47b 100644
> --- a/drivers/i2c/muxes/i2c-mux-reg.c
> +++ b/drivers/i2c/muxes/i2c-mux-reg.c
> @@ -127,10 +127,8 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
>  	values = devm_kzalloc(&pdev->dev,
>  			      sizeof(*mux->data.values) * mux->data.n_values,
>  			      GFP_KERNEL);
> -	if (!values) {
> -		dev_err(&pdev->dev, "Cannot allocate values array");
> +	if (!values)
>  		return -ENOMEM;
> -	}
>  
>  	for_each_child_of_node(np, child) {
>  		of_property_read_u32(child, "reg", values + i);

Patch

diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index c948e5a4cb04..f624ed64a47b 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -127,10 +127,8 @@  static int i2c_mux_reg_probe_dt(struct regmux *mux,
 	values = devm_kzalloc(&pdev->dev,
 			      sizeof(*mux->data.values) * mux->data.n_values,
 			      GFP_KERNEL);
-	if (!values) {
-		dev_err(&pdev->dev, "Cannot allocate values array");
+	if (!values)
 		return -ENOMEM;
-	}
 
 	for_each_child_of_node(np, child) {
 		of_property_read_u32(child, "reg", values + i);