From: Markus Elfring Date: Sat, 2 Sep 2017 14:07:31 +0000 (-0300) Subject: [media] i2c: Delete an error messages for failed memory allocation X-Git-Tag: v4.19~2007^2~279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fd58435890aa9f2d44baaa2f328f7f8f512f4dc;p=platform%2Fkernel%2Flinux-rpi.git [media] i2c: Delete an error messages for failed memory allocation Omit extra messages for memory allocation failures. This issue was detected by using the Coccinelle software. [mchehab@s-opensource.com: merged similar patches] Signed-off-by: Markus Elfring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 5f013c8..c0d0c50 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -1098,11 +1098,8 @@ static int ov2640_probe(struct i2c_client *client, } priv = devm_kzalloc(&client->dev, sizeof(struct ov2640_priv), GFP_KERNEL); - if (!priv) { - dev_err(&adapter->dev, - "Failed to allocate memory for private data!\n"); + if (!priv) return -ENOMEM; - } if (client->dev.of_node) { priv->clk = devm_clk_get(&client->dev, "xvclk"); diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c index 768f295..8975d16 100644 --- a/drivers/media/i2c/ov6650.c +++ b/drivers/media/i2c/ov6650.c @@ -951,11 +951,8 @@ static int ov6650_probe(struct i2c_client *client, int ret; priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(&client->dev, - "Failed to allocate memory for private data!\n"); + if (!priv) return -ENOMEM; - } v4l2_i2c_subdev_init(&priv->subdev, client, &ov6650_subdev_ops); v4l2_ctrl_handler_init(&priv->hdl, 13); diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c index dafea6d..8835008 100644 --- a/drivers/media/i2c/soc_camera/ov9640.c +++ b/drivers/media/i2c/soc_camera/ov9640.c @@ -676,11 +676,8 @@ static int ov9640_probe(struct i2c_client *client, } priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL); - if (!priv) { - dev_err(&client->dev, - "Failed to allocate memory for private data!\n"); + if (!priv) return -ENOMEM; - } v4l2_i2c_subdev_init(&priv->subdev, client, &ov9640_subdev_ops); diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c index cc07b7a..f44f5da 100644 --- a/drivers/media/i2c/soc_camera/ov9740.c +++ b/drivers/media/i2c/soc_camera/ov9740.c @@ -936,10 +936,8 @@ static int ov9740_probe(struct i2c_client *client, } priv = devm_kzalloc(&client->dev, sizeof(struct ov9740_priv), GFP_KERNEL); - if (!priv) { - dev_err(&client->dev, "Failed to allocate private data!\n"); + if (!priv) return -ENOMEM; - } v4l2_i2c_subdev_init(&priv->subdev, client, &ov9740_subdev_ops); v4l2_ctrl_handler_init(&priv->hdl, 13);