Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <elfring@users.sourceforge.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Markus Elfring and committed by
Mauro Carvalho Chehab
0fd58435 3eefbc69

+4 -15
+1 -4
drivers/media/i2c/ov2640.c
··· 1098 1098 } 1099 1099 1100 1100 priv = devm_kzalloc(&client->dev, sizeof(struct ov2640_priv), GFP_KERNEL); 1101 - if (!priv) { 1102 - dev_err(&adapter->dev, 1103 - "Failed to allocate memory for private data!\n"); 1101 + if (!priv) 1104 1102 return -ENOMEM; 1105 - } 1106 1103 1107 1104 if (client->dev.of_node) { 1108 1105 priv->clk = devm_clk_get(&client->dev, "xvclk");
+1 -4
drivers/media/i2c/ov6650.c
··· 951 951 int ret; 952 952 953 953 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); 954 - if (!priv) { 955 - dev_err(&client->dev, 956 - "Failed to allocate memory for private data!\n"); 954 + if (!priv) 957 955 return -ENOMEM; 958 - } 959 956 960 957 v4l2_i2c_subdev_init(&priv->subdev, client, &ov6650_subdev_ops); 961 958 v4l2_ctrl_handler_init(&priv->hdl, 13);
+1 -4
drivers/media/i2c/soc_camera/ov9640.c
··· 676 676 } 677 677 678 678 priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL); 679 - if (!priv) { 680 - dev_err(&client->dev, 681 - "Failed to allocate memory for private data!\n"); 679 + if (!priv) 682 680 return -ENOMEM; 683 - } 684 681 685 682 v4l2_i2c_subdev_init(&priv->subdev, client, &ov9640_subdev_ops); 686 683
+1 -3
drivers/media/i2c/soc_camera/ov9740.c
··· 936 936 } 937 937 938 938 priv = devm_kzalloc(&client->dev, sizeof(struct ov9740_priv), GFP_KERNEL); 939 - if (!priv) { 940 - dev_err(&client->dev, "Failed to allocate private data!\n"); 939 + if (!priv) 941 940 return -ENOMEM; 942 - } 943 941 944 942 v4l2_i2c_subdev_init(&priv->subdev, client, &ov9740_subdev_ops); 945 943 v4l2_ctrl_handler_init(&priv->hdl, 13);