Discussion:
[PATCH 00/25] cleanup unnecessary 'out of memory' messages for usb
Peter Chen
2014-10-14 07:55:54 UTC
Permalink
Hi Greg,

Fabio Estevam posted the similar patches for chipidea, I think the cleanup
may also be benefix for the whole usb driver, the idea of this cleanup
is from:

commit ebfdc40969f24fc0cdd1349835d36e8ebae05374
Author: Joe Perches <joe-***@public.gmane.org>
Date: Wed Aug 6 16:10:27 2014 -0700

checkpatch: attempt to find unnecessary 'out of memory' messages

Logging messages that show some type of "out of memory" error are
generally unnecessary as there is a generic message and a stack dump
done by the memory subsystem.

These messages generally increase kernel size without much added value.


Peter Chen (25):
usb: chipidea: otg_fsm: delete unnecessary 'out of memory' messages
usb: class: usbtmc: delete unnecessary 'out of memory' messages
usb: gadget: mv_udc_core: delete unnecessary 'out of memory' messages
usb: gadget: fsl_qe_udc: delete unnecessary 'out of memory' messages
usb: gadget: bcm63xx_udc: delete unnecessary 'out of memory' messages
usb: gadget: s3c-hsudc: delete unnecessary 'out of memory' messages
usb: host: ehci-mv: delete unnecessary 'out of memory' messages
usb: host: ehci-sh: delete unnecessary 'out of memory' messages
usb: host: ehci-tegra: delete unnecessary 'out of memory' messages
usb: host: oxu210hp-hcd: delete unnecessary 'out of memory' messages
usb: misc: usb3503: delete unnecessary 'out of memory' messages
usb: musb: davinci: delete unnecessary 'out of memory' messages
usb: musb: ux500: delete unnecessary 'out of memory' messages
usb: musb: omap2430: delete unnecessary 'out of memory' messages
usb: musb: blackfin: delete unnecessary 'out of memory' messages
usb: musb: tusb6010: delete unnecessary 'out of memory' messages
usb: musb: musb_dsps: delete unnecessary 'out of memory' messages
usb: phy: phy-rcar-usb: delete unnecessary 'out of memory' messages
usb: phy: phy-tegra-usb: delete unnecessary 'out of memory' messages
usb: phy: phy-am335x-control: delete unnecessary 'out of memory'
messages
usb: phy: phy-rcar-gen2-usb: delete unnecessary 'out of memory'
messages
usb: phy: phy-mxs-usb: delete unnecessary 'out of memory' messages
usb: phy: phy-msm-usb: delete unnecessary 'out of memory' messages
usb: phy: phy-mv-usb: delete unnecessary 'out of memory' messages
usb: renesas_usbhs: delete unnecessary 'out of memory' messages

drivers/usb/chipidea/otg_fsm.c | 10 ++--------
drivers/usb/class/usbtmc.c | 4 +---
drivers/usb/gadget/udc/bcm63xx_udc.c | 4 +---
drivers/usb/gadget/udc/fsl_qe_udc.c | 1 -
drivers/usb/gadget/udc/mv_udc_core.c | 6 +-----
drivers/usb/gadget/udc/s3c-hsudc.c | 4 +---
drivers/usb/host/ehci-mv.c | 1 -
drivers/usb/host/ehci-sh.c | 1 -
drivers/usb/host/ehci-tegra.c | 1 -
drivers/usb/host/oxu210hp-hcd.c | 1 -
drivers/usb/misc/usb3503.c | 8 ++------
drivers/usb/musb/blackfin.c | 8 ++------
drivers/usb/musb/davinci.c | 4 +---
drivers/usb/musb/musb_dsps.c | 5 +----
drivers/usb/musb/omap2430.c | 19 ++++---------------
drivers/usb/musb/tusb6010.c | 4 +---
drivers/usb/musb/ux500.c | 4 +---
drivers/usb/phy/phy-am335x-control.c | 4 +---
drivers/usb/phy/phy-msm-usb.c | 12 +++---------
drivers/usb/phy/phy-mv-usb.c | 4 +---
drivers/usb/phy/phy-mxs-usb.c | 4 +---
drivers/usb/phy/phy-rcar-gen2-usb.c | 4 +---
drivers/usb/phy/phy-rcar-usb.c | 4 +---
drivers/usb/phy/phy-tegra-usb.c | 9 ++-------
drivers/usb/renesas_usbhs/common.c | 4 +---
25 files changed, 29 insertions(+), 101 deletions(-)
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:55:55 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/chipidea/otg_fsm.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index caaabc5..e683595 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -782,11 +782,8 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)

otg = devm_kzalloc(ci->dev,
sizeof(struct usb_otg), GFP_KERNEL);
- if (!otg) {
- dev_err(ci->dev,
- "Failed to allocate usb_otg structure for ci hdrc otg!\n");
+ if (!otg)
return -ENOMEM;
- }

otg->phy = ci->transceiver;
otg->gadget = &ci->gadget;
@@ -801,11 +798,8 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)

ci->fsm_timer = devm_kzalloc(ci->dev,
sizeof(struct ci_otg_fsm_timer_list), GFP_KERNEL);
- if (!ci->fsm_timer) {
- dev_err(ci->dev,
- "Failed to allocate timer structure for ci hdrc otg!\n");
+ if (!ci->fsm_timer)
return -ENOMEM;
- }

INIT_LIST_HEAD(&ci->fsm_timer->active_timers);
retval = ci_otg_init_timers(ci);
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:55:56 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/class/usbtmc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index ec97840..960bc08 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1104,10 +1104,8 @@ static int usbtmc_probe(struct usb_interface *intf,
dev_dbg(&intf->dev, "%s called\n", __func__);

data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
- if (!data) {
- dev_err(&intf->dev, "Unable to allocate kernel memory\n");
+ if (!data)
return -ENOMEM;
- }

data->intf = intf;
data->id = id;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:55:57 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/gadget/udc/mv_udc_core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
index 3c5db80..cebb948 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -2107,10 +2107,8 @@ static int mv_udc_probe(struct platform_device *pdev)
}

udc = devm_kzalloc(&pdev->dev, sizeof(*udc), GFP_KERNEL);
- if (udc == NULL) {
- dev_err(&pdev->dev, "failed to allocate memory for udc\n");
+ if (udc == NULL)
return -ENOMEM;
- }

udc->done = &release_done;
udc->pdata = dev_get_platdata(&pdev->dev);
@@ -2207,7 +2205,6 @@ static int mv_udc_probe(struct platform_device *pdev)
size = udc->max_eps * sizeof(struct mv_ep) *2;
udc->eps = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
if (udc->eps == NULL) {
- dev_err(&pdev->dev, "allocate ep memory failed\n");
retval = -ENOMEM;
goto err_destroy_dma;
}
@@ -2216,7 +2213,6 @@ static int mv_udc_probe(struct platform_device *pdev)
udc->status_req = devm_kzalloc(&pdev->dev, sizeof(struct mv_req),
GFP_KERNEL);
if (!udc->status_req) {
- dev_err(&pdev->dev, "allocate status_req memory failed\n");
retval = -ENOMEM;
goto err_destroy_dma;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:55:58 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/gadget/udc/fsl_qe_udc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
index dd18ea3..6601b0f 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
@@ -2538,7 +2538,6 @@ static int qe_udc_probe(struct platform_device *ofdev)
/* create a buf for ZLP send, need to remain zeroed */
udc->nullbuf = devm_kzalloc(&ofdev->dev, 256, GFP_KERNEL);
if (udc->nullbuf == NULL) {
- dev_err(udc->dev, "cannot alloc nullbuf\n");
ret = -ENOMEM;
goto err3;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:55:59 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/gadget/udc/bcm63xx_udc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index 2235b88..485c8c2 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -2324,10 +2324,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
int rc = -ENOMEM, i, irq;

udc = devm_kzalloc(dev, sizeof(*udc), GFP_KERNEL);
- if (!udc) {
- dev_err(dev, "cannot allocate memory\n");
+ if (!udc)
return -ENOMEM;
- }

platform_set_drvdata(pdev, udc);
udc->dev = dev;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:00 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/gadget/udc/s3c-hsudc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c b/drivers/usb/gadget/udc/s3c-hsudc.c
index dfbf557..f658f69 100644
--- a/drivers/usb/gadget/udc/s3c-hsudc.c
+++ b/drivers/usb/gadget/udc/s3c-hsudc.c
@@ -1267,10 +1267,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
hsudc = devm_kzalloc(&pdev->dev, sizeof(struct s3c_hsudc) +
sizeof(struct s3c_hsudc_ep) * pd->epnum,
GFP_KERNEL);
- if (!hsudc) {
- dev_err(dev, "cannot allocate memory\n");
+ if (!hsudc)
return -ENOMEM;
- }

platform_set_drvdata(pdev, dev);
hsudc->dev = dev;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:01 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/host/ehci-mv.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 08147c3..b1855c1 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -153,7 +153,6 @@ static int mv_ehci_probe(struct platform_device *pdev)

ehci_mv = devm_kzalloc(&pdev->dev, sizeof(*ehci_mv), GFP_KERNEL);
if (ehci_mv == NULL) {
- dev_err(&pdev->dev, "cannot allocate ehci_hcd_mv\n");
retval = -ENOMEM;
goto err_put_hcd;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:06 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/davinci.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 110b784..04de3ac 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -520,10 +520,8 @@ static int davinci_probe(struct platform_device *pdev)
int ret = -ENOMEM;

glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "failed to allocate glue context\n");
+ if (!glue)
goto err0;
- }

clk = devm_clk_get(&pdev->dev, "usb");
if (IS_ERR(clk)) {
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:04 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/host/oxu210hp-hcd.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 4fe79a2..75811dd 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -3846,7 +3846,6 @@ static int oxu_drv_probe(struct platform_device *pdev)
*/
info = devm_kzalloc(&pdev->dev, sizeof(struct oxu_info), GFP_KERNEL);
if (!info) {
- dev_dbg(&pdev->dev, "error allocating memory\n");
ret = -EFAULT;
goto error;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:07 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/ux500.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index dc666e9..d0180a7 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -247,10 +247,8 @@ static int ux500_probe(struct platform_device *pdev)
}

glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "failed to allocate glue context\n");
+ if (!glue)
goto err0;
- }

musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
if (!musb) {
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:11 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/musb_dsps.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 154bcf1..b2a1265 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -729,7 +729,6 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,

config = devm_kzalloc(&parent->dev, sizeof(*config), GFP_KERNEL);
if (!config) {
- dev_err(dev, "failed to allocate musb hdrc config\n");
ret = -ENOMEM;
goto err;
}
@@ -781,10 +780,8 @@ static int dsps_probe(struct platform_device *pdev)

/* allocate glue */
glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "unable to allocate glue memory\n");
+ if (!glue)
return -ENOMEM;
- }

glue->dev = &pdev->dev;
glue->wrp = wrp;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:03 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/host/ehci-tegra.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index aaa0197..3e6f685 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -484,7 +484,6 @@ static int tegra_ehci_probe(struct platform_device *pdev)
u_phy->otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
GFP_KERNEL);
if (!u_phy->otg) {
- dev_err(&pdev->dev, "Failed to alloc memory for otg\n");
err = -ENOMEM;
goto cleanup_phy;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:05 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/misc/usb3503.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index ae7e120..b9af8cb 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -314,10 +314,8 @@ static int usb3503_i2c_probe(struct i2c_client *i2c,
int err;

hub = devm_kzalloc(&i2c->dev, sizeof(struct usb3503), GFP_KERNEL);
- if (!hub) {
- dev_err(&i2c->dev, "private data alloc fail\n");
+ if (!hub)
return -ENOMEM;
- }

i2c_set_clientdata(i2c, hub);
hub->regmap = devm_regmap_init_i2c(i2c, &usb3503_regmap_config);
@@ -336,10 +334,8 @@ static int usb3503_platform_probe(struct platform_device *pdev)
struct usb3503 *hub;

hub = devm_kzalloc(&pdev->dev, sizeof(struct usb3503), GFP_KERNEL);
- if (!hub) {
- dev_err(&pdev->dev, "private data alloc fail\n");
+ if (!hub)
return -ENOMEM;
- }
hub->dev = &pdev->dev;

return usb3503_probe(hub);
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:12 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-rcar-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c
index 33265a5..4879596 100644
--- a/drivers/usb/phy/phy-rcar-usb.c
+++ b/drivers/usb/phy/phy-rcar-usb.c
@@ -202,10 +202,8 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)
}

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(dev, "priv data allocation error\n");
+ if (!priv)
return -ENOMEM;
- }

priv->reg0 = reg0;
priv->reg1 = reg1;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:08 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/omap2430.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index d369bf1..6669f26 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -518,10 +518,8 @@ static int omap2430_probe(struct platform_device *pdev)
int ret = -ENOMEM;

glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "failed to allocate glue context\n");
+ if (!glue)
goto err0;
- }

musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
if (!musb) {
@@ -543,25 +541,16 @@ static int omap2430_probe(struct platform_device *pdev)
struct platform_device *control_pdev;

pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata) {
- dev_err(&pdev->dev,
- "failed to allocate musb platform data\n");
+ if (!pdata)
goto err2;
- }

data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
- if (!data) {
- dev_err(&pdev->dev,
- "failed to allocate musb board data\n");
+ if (!data)
goto err2;
- }

config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
- if (!config) {
- dev_err(&pdev->dev,
- "failed to allocate musb hdrc config\n");
+ if (!config)
goto err2;
- }

of_property_read_u32(np, "mode", (u32 *)&pdata->mode);
of_property_read_u32(np, "interface-type",
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:13 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-tegra-usb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 886f180..fa2bfa4 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -880,11 +880,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,

tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
GFP_KERNEL);
- if (!tegra_phy->config) {
- dev_err(&pdev->dev,
- "unable to allocate memory for USB UTMIP config\n");
+ if (!tegra_phy->config)
return -ENOMEM;
- }

config = tegra_phy->config;

@@ -979,10 +976,8 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
int err;

tegra_phy = devm_kzalloc(&pdev->dev, sizeof(*tegra_phy), GFP_KERNEL);
- if (!tegra_phy) {
- dev_err(&pdev->dev, "unable to allocate memory for USB2 PHY\n");
+ if (!tegra_phy)
return -ENOMEM;
- }

match = of_match_device(tegra_usb_phy_id_table, &pdev->dev);
if (!match) {
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:09 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/blackfin.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index ac4422b..8554c6f 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -456,16 +456,12 @@ static int bfin_probe(struct platform_device *pdev)
int ret = -ENOMEM;

glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "failed to allocate glue context\n");
+ if (!glue)
goto err0;
- }

musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
- if (!musb) {
- dev_err(&pdev->dev, "failed to allocate musb device\n");
+ if (!musb)
goto err0;
- }

musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &bfin_dmamask;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:16 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-mxs-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 0e0c415..a55dadc 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -390,10 +390,8 @@ static int mxs_phy_probe(struct platform_device *pdev)
}

mxs_phy = devm_kzalloc(&pdev->dev, sizeof(*mxs_phy), GFP_KERNEL);
- if (!mxs_phy) {
- dev_err(&pdev->dev, "Failed to allocate USB PHY structure!\n");
+ if (!mxs_phy)
return -ENOMEM;
- }

/* Some SoCs don't have anatop registers */
if (of_get_property(np, "fsl,anatop", NULL)) {
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:14 UTC
Permalink
This post might be inappropriate. Click to display it.
Peter Chen
2014-10-14 07:56:15 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-rcar-gen2-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c b/drivers/usb/phy/phy-rcar-gen2-usb.c
index 388d89f..f838084 100644
--- a/drivers/usb/phy/phy-rcar-gen2-usb.c
+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
@@ -195,10 +195,8 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
return PTR_ERR(base);

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(dev, "Memory allocation failed\n");
+ if (!priv)
return -ENOMEM;
- }

spin_lock_init(&priv->lock);
priv->clk = clk;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:17 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-msm-usb.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 7843ef7..471e69d 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1505,10 +1505,8 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
}

pdata->phy_init_seq = devm_kzalloc(&pdev->dev, len, GFP_KERNEL);
- if (!pdata->phy_init_seq) {
- dev_warn(&pdev->dev, "No space for PHY init sequence\n");
+ if (!pdata->phy_init_seq)
return 0;
- }

ret = of_property_read_u32_array(node, "qcom,phy-init-sequence",
pdata->phy_init_seq, words);
@@ -1530,10 +1528,8 @@ static int msm_otg_probe(struct platform_device *pdev)
void __iomem *phy_select;

motg = devm_kzalloc(&pdev->dev, sizeof(struct msm_otg), GFP_KERNEL);
- if (!motg) {
- dev_err(&pdev->dev, "unable to allocate msm_otg\n");
+ if (!motg)
return -ENOMEM;
- }

pdata = dev_get_platdata(&pdev->dev);
if (!pdata) {
@@ -1546,10 +1542,8 @@ static int msm_otg_probe(struct platform_device *pdev)

motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
GFP_KERNEL);
- if (!motg->phy.otg) {
- dev_err(&pdev->dev, "unable to allocate msm_otg\n");
+ if (!motg->phy.otg)
return -ENOMEM;
- }

phy = &motg->phy;
phy->dev = &pdev->dev;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:19 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/renesas_usbhs/common.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index b3b6813..6dae115 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -505,10 +505,8 @@ static int usbhs_probe(struct platform_device *pdev)

/* usb private data */
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(&pdev->dev, "Could not allocate priv\n");
+ if (!priv)
return -ENOMEM;
- }

priv->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->base))
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:18 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/phy/phy-mv-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index 7d80c54..c9517d8 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -686,10 +686,8 @@ static int mv_otg_probe(struct platform_device *pdev)
}

mvotg = devm_kzalloc(&pdev->dev, sizeof(*mvotg), GFP_KERNEL);
- if (!mvotg) {
- dev_err(&pdev->dev, "failed to allocate memory!\n");
+ if (!mvotg)
return -ENOMEM;
- }

otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
if (!otg)
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:10 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/musb/tusb6010.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 2daa779..25f02df 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1164,10 +1164,8 @@ static int tusb_probe(struct platform_device *pdev)
int ret;

glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue) {
- dev_err(&pdev->dev, "failed to allocate glue context\n");
+ if (!glue)
return -ENOMEM;
- }

glue->dev = &pdev->dev;
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Chen
2014-10-14 07:56:02 UTC
Permalink
The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen-***@public.gmane.org>
---
drivers/usb/host/ehci-sh.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
index 9b9b9f5..f9ebf8a 100644
--- a/drivers/usb/host/ehci-sh.c
+++ b/drivers/usb/host/ehci-sh.c
@@ -126,7 +126,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
priv = devm_kzalloc(&pdev->dev, sizeof(struct ehci_sh_priv),
GFP_KERNEL);
if (!priv) {
- dev_dbg(&pdev->dev, "error allocating priv data\n");
ret = -ENOMEM;
goto fail_request_resource;
}
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg KH
2014-10-14 08:08:39 UTC
Permalink
Post by Peter Chen
Hi Greg,
Fabio Estevam posted the similar patches for chipidea, I think the cleanup
may also be benefix for the whole usb driver, the idea of this cleanup
commit ebfdc40969f24fc0cdd1349835d36e8ebae05374
Date: Wed Aug 6 16:10:27 2014 -0700
checkpatch: attempt to find unnecessary 'out of memory' messages
Logging messages that show some type of "out of memory" error are
generally unnecessary as there is a generic message and a stack dump
done by the memory subsystem.
These messages generally increase kernel size without much added value.
I have no objection to them, but can't add them to my tree until after
3.18-rc1 is out, so it will have to wait a week or so.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Felipe Balbi
2014-10-14 14:27:40 UTC
Permalink
Post by Greg KH
Post by Peter Chen
Hi Greg,
Fabio Estevam posted the similar patches for chipidea, I think the cleanup
may also be benefix for the whole usb driver, the idea of this cleanup
commit ebfdc40969f24fc0cdd1349835d36e8ebae05374
Date: Wed Aug 6 16:10:27 2014 -0700
checkpatch: attempt to find unnecessary 'out of memory' messages
Logging messages that show some type of "out of memory" error are
generally unnecessary as there is a generic message and a stack dump
done by the memory subsystem.
These messages generally increase kernel size without much added value.
I have no objection to them, but can't add them to my tree until after
3.18-rc1 is out, so it will have to wait a week or so.
If you don't mind, I'll take gadget, musb, dwc3, dwc2 and phy.
--
balbi
Greg KH
2014-10-16 09:25:18 UTC
Permalink
Post by Felipe Balbi
Post by Greg KH
Post by Peter Chen
Hi Greg,
Fabio Estevam posted the similar patches for chipidea, I think the cleanup
may also be benefix for the whole usb driver, the idea of this cleanup
commit ebfdc40969f24fc0cdd1349835d36e8ebae05374
Date: Wed Aug 6 16:10:27 2014 -0700
checkpatch: attempt to find unnecessary 'out of memory' messages
Logging messages that show some type of "out of memory" error are
generally unnecessary as there is a generic message and a stack dump
done by the memory subsystem.
These messages generally increase kernel size without much added value.
I have no objection to them, but can't add them to my tree until after
3.18-rc1 is out, so it will have to wait a week or so.
If you don't mind, I'll take gadget, musb, dwc3, dwc2 and phy.
I don't mind at all.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...