From: Markus Elfring Date: Thu, 1 Feb 2018 16:17:19 +0000 (+0100) Subject: i2c: mux: reg: failed memory allocation is logged elsewhere X-Git-Tag: v4.19~785^2~4^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b30c08a24caa89b28c84f09f0d1de94e9017cc36;p=platform%2Fkernel%2Flinux-rpi.git i2c: mux: reg: failed memory allocation is logged elsewhere 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 Reviewed-by: Alexander Sverdlin Signed-off-by: Peter Rosin --- diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c index c948e5a..f624ed6 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);