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

i2c: remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message. For example,
k.alloc and v.alloc failures use dump_stack().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Jingoo Han and committed by
Wolfram Sang
46797a2a 157a801e

+14 -44
+1 -3
drivers/i2c/busses/i2c-bcm2835.c
··· 225 225 struct i2c_adapter *adap; 226 226 227 227 i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL); 228 - if (!i2c_dev) { 229 - dev_err(&pdev->dev, "Cannot allocate i2c_dev\n"); 228 + if (!i2c_dev) 230 229 return -ENOMEM; 231 - } 232 230 platform_set_drvdata(pdev, i2c_dev); 233 231 i2c_dev->dev = &pdev->dev; 234 232 init_completion(&i2c_dev->completion);
-1
drivers/i2c/busses/i2c-diolan-u2c.c
··· 455 455 /* allocate memory for our device state and initialize it */ 456 456 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 457 457 if (dev == NULL) { 458 - dev_err(&interface->dev, "no memory for device state\n"); 459 458 ret = -ENOMEM; 460 459 goto error; 461 460 }
+1 -3
drivers/i2c/busses/i2c-efm32.c
··· 320 320 return -EINVAL; 321 321 322 322 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); 323 - if (!ddata) { 324 - dev_dbg(&pdev->dev, "failed to allocate private data\n"); 323 + if (!ddata) 325 324 return -ENOMEM; 326 - } 327 325 platform_set_drvdata(pdev, ddata); 328 326 329 327 init_completion(&ddata->done);
+1 -3
drivers/i2c/busses/i2c-eg20t.c
··· 751 751 pch_pci_dbg(pdev, "Entered.\n"); 752 752 753 753 adap_info = kzalloc((sizeof(struct adapter_info)), GFP_KERNEL); 754 - if (adap_info == NULL) { 755 - pch_pci_err(pdev, "Memory allocation FAILED\n"); 754 + if (adap_info == NULL) 756 755 return -ENOMEM; 757 - } 758 756 759 757 ret = pci_enable_device(pdev); 760 758 if (ret) {
+1 -3
drivers/i2c/busses/i2c-exynos5.c
··· 662 662 int ret; 663 663 664 664 i2c = devm_kzalloc(&pdev->dev, sizeof(struct exynos5_i2c), GFP_KERNEL); 665 - if (!i2c) { 666 - dev_err(&pdev->dev, "no memory for state\n"); 665 + if (!i2c) 667 666 return -ENOMEM; 668 - } 669 667 670 668 if (of_property_read_u32(np, "clock-frequency", &op_clock)) { 671 669 i2c->speed_mode = HSI2C_FAST_SPD;
+1 -3
drivers/i2c/busses/i2c-imx.c
··· 667 667 668 668 i2c_imx = devm_kzalloc(&pdev->dev, sizeof(struct imx_i2c_struct), 669 669 GFP_KERNEL); 670 - if (!i2c_imx) { 671 - dev_err(&pdev->dev, "can't allocate interface\n"); 670 + if (!i2c_imx) 672 671 return -ENOMEM; 673 - } 674 672 675 673 if (of_id) 676 674 i2c_imx->hwdata = of_id->data;
+1 -3
drivers/i2c/busses/i2c-omap.c
··· 1114 1114 } 1115 1115 1116 1116 dev = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL); 1117 - if (!dev) { 1118 - dev_err(&pdev->dev, "Menory allocation failed\n"); 1117 + if (!dev) 1119 1118 return -ENOMEM; 1120 - } 1121 1119 1122 1120 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1123 1121 dev->base = devm_ioremap_resource(&pdev->dev, mem);
+1 -3
drivers/i2c/busses/i2c-rcar.c
··· 509 509 int irq, ret; 510 510 511 511 priv = devm_kzalloc(dev, sizeof(struct rcar_i2c_priv), GFP_KERNEL); 512 - if (!priv) { 513 - dev_err(dev, "no mem for private data\n"); 512 + if (!priv) 514 513 return -ENOMEM; 515 - } 516 514 517 515 priv->clk = devm_clk_get(dev, NULL); 518 516 if (IS_ERR(priv->clk)) {
+2 -6
drivers/i2c/busses/i2c-s3c2410.c
··· 1114 1114 } 1115 1115 1116 1116 i2c = devm_kzalloc(&pdev->dev, sizeof(struct s3c24xx_i2c), GFP_KERNEL); 1117 - if (!i2c) { 1118 - dev_err(&pdev->dev, "no memory for state\n"); 1117 + if (!i2c) 1119 1118 return -ENOMEM; 1120 - } 1121 1119 1122 1120 i2c->pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 1123 - if (!i2c->pdata) { 1124 - dev_err(&pdev->dev, "no memory for platform data\n"); 1121 + if (!i2c->pdata) 1125 1122 return -ENOMEM; 1126 - } 1127 1123 1128 1124 i2c->quirks = s3c24xx_get_device_quirks(pdev); 1129 1125 if (pdata)
+1 -3
drivers/i2c/busses/i2c-simtec.c
··· 77 77 int ret; 78 78 79 79 pd = kzalloc(sizeof(struct simtec_i2c_data), GFP_KERNEL); 80 - if (pd == NULL) { 81 - dev_err(&dev->dev, "cannot allocate private data\n"); 80 + if (pd == NULL) 82 81 return -ENOMEM; 83 - } 84 82 85 83 platform_set_drvdata(dev, pd); 86 84
-1
drivers/i2c/busses/i2c-sirf.c
··· 307 307 308 308 siic = devm_kzalloc(&pdev->dev, sizeof(*siic), GFP_KERNEL); 309 309 if (!siic) { 310 - dev_err(&pdev->dev, "Can't allocate driver data\n"); 311 310 err = -ENOMEM; 312 311 goto out; 313 312 }
+1 -3
drivers/i2c/busses/i2c-stu300.c
··· 868 868 int ret = 0; 869 869 870 870 dev = devm_kzalloc(&pdev->dev, sizeof(struct stu300_dev), GFP_KERNEL); 871 - if (!dev) { 872 - dev_err(&pdev->dev, "could not allocate device struct\n"); 871 + if (!dev) 873 872 return -ENOMEM; 874 - } 875 873 876 874 bus_nr = pdev->id; 877 875 dev->clk = devm_clk_get(&pdev->dev, NULL);
+1 -3
drivers/i2c/busses/i2c-tegra.c
··· 732 732 } 733 733 734 734 i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL); 735 - if (!i2c_dev) { 736 - dev_err(&pdev->dev, "Could not allocate struct tegra_i2c_dev"); 735 + if (!i2c_dev) 737 736 return -ENOMEM; 738 - } 739 737 740 738 i2c_dev->base = base; 741 739 i2c_dev->div_clk = div_clk;
+1 -3
drivers/i2c/busses/i2c-wmt.c
··· 379 379 u32 clk_rate; 380 380 381 381 i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL); 382 - if (!i2c_dev) { 383 - dev_err(&pdev->dev, "device memory allocation failed\n"); 382 + if (!i2c_dev) 384 383 return -ENOMEM; 385 - } 386 384 387 385 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 388 386 i2c_dev->base = devm_ioremap_resource(&pdev->dev, res);
+1 -3
drivers/i2c/busses/scx200_acb.c
··· 431 431 struct i2c_adapter *adapter; 432 432 433 433 iface = kzalloc(sizeof(*iface), GFP_KERNEL); 434 - if (!iface) { 435 - pr_err("can't allocate memory\n"); 434 + if (!iface) 436 435 return NULL; 437 - } 438 436 439 437 adapter = &iface->adapter; 440 438 i2c_set_adapdata(adapter, iface);