i2c: Delete error messages for failed memory allocations
[ Upstream commit 6b3b21a8542fd2fb6ffc61bc13b9419f0c58ebad ] These issues were detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Wolfram Sang <wsa@kernel.org> Stable-dep-of: 05f933d5f731 ("i2c: nomadik: Remove a useless call in the remove function") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
52df40a5c7
commit
41e90f0e50
@@ -694,10 +694,8 @@ static int iic_probe(struct platform_device *ofdev)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
if (!dev) {
|
if (!dev)
|
||||||
dev_err(&ofdev->dev, "failed to allocate device data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
platform_set_drvdata(ofdev, dev);
|
platform_set_drvdata(ofdev, dev);
|
||||||
|
|
||||||
|
@@ -972,7 +972,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
|
|||||||
|
|
||||||
dev = devm_kzalloc(&adev->dev, sizeof(struct nmk_i2c_dev), GFP_KERNEL);
|
dev = devm_kzalloc(&adev->dev, sizeof(struct nmk_i2c_dev), GFP_KERNEL);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
dev_err(&adev->dev, "cannot allocate memory\n");
|
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_no_mem;
|
goto err_no_mem;
|
||||||
}
|
}
|
||||||
|
@@ -445,7 +445,6 @@ static int sh7760_i2c_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
id = kzalloc(sizeof(struct cami2c), GFP_KERNEL);
|
id = kzalloc(sizeof(struct cami2c), GFP_KERNEL);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
dev_err(&pdev->dev, "no mem for private data\n");
|
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out0;
|
goto out0;
|
||||||
}
|
}
|
||||||
|
@@ -226,10 +226,8 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
|
|||||||
|
|
||||||
/* allocate memory for our device state and initialize it */
|
/* allocate memory for our device state and initialize it */
|
||||||
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
if (dev == NULL) {
|
if (!dev)
|
||||||
dev_err(&interface->dev, "Out of memory\n");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
dev->usb_dev = usb_get_dev(interface_to_usbdev(interface));
|
dev->usb_dev = usb_get_dev(interface_to_usbdev(interface));
|
||||||
dev->interface = interface;
|
dev->interface = interface;
|
||||||
|
Reference in New Issue
Block a user