Re: [PATCH 20/23] regulator: wm831x-dcdc: Remove redundant error message
On Thu, Feb 20, 2014 at 02:23:20PM +0530, Sachin Kamat wrote: > kzalloc prints its own OOM message upon failure. Applied, thanks. signature.asc Description: Digital signature
[PATCH 20/23] regulator: wm831x-dcdc: Remove redundant error message
kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat --- drivers/regulator/wm831x-dcdc.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 04cf9c16ef23..0d88a82ab2a2 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -469,10 +469,8 @@ static int wm831x_buckv_probe(struct platform_device *pdev) dcdc = devm_kzalloc(>dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(>dev, "Unable to allocate private data\n"); + if (!dcdc) return -ENOMEM; - } dcdc->wm831x = wm831x; @@ -622,10 +620,8 @@ static int wm831x_buckp_probe(struct platform_device *pdev) dcdc = devm_kzalloc(>dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(>dev, "Unable to allocate private data\n"); + if (!dcdc) return -ENOMEM; - } dcdc->wm831x = wm831x; @@ -752,10 +748,8 @@ static int wm831x_boostp_probe(struct platform_device *pdev) return -ENODEV; dcdc = devm_kzalloc(>dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(>dev, "Unable to allocate private data\n"); + if (!dcdc) return -ENOMEM; - } dcdc->wm831x = wm831x; @@ -842,10 +836,8 @@ static int wm831x_epe_probe(struct platform_device *pdev) dev_dbg(>dev, "Probing EPE%d\n", id + 1); dcdc = devm_kzalloc(>dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(>dev, "Unable to allocate private data\n"); + if (!dcdc) return -ENOMEM; - } dcdc->wm831x = wm831x; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 20/23] regulator: wm831x-dcdc: Remove redundant error message
kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat sachin.ka...@linaro.org --- drivers/regulator/wm831x-dcdc.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 04cf9c16ef23..0d88a82ab2a2 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -469,10 +469,8 @@ static int wm831x_buckv_probe(struct platform_device *pdev) dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(pdev-dev, Unable to allocate private data\n); + if (!dcdc) return -ENOMEM; - } dcdc-wm831x = wm831x; @@ -622,10 +620,8 @@ static int wm831x_buckp_probe(struct platform_device *pdev) dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(pdev-dev, Unable to allocate private data\n); + if (!dcdc) return -ENOMEM; - } dcdc-wm831x = wm831x; @@ -752,10 +748,8 @@ static int wm831x_boostp_probe(struct platform_device *pdev) return -ENODEV; dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(pdev-dev, Unable to allocate private data\n); + if (!dcdc) return -ENOMEM; - } dcdc-wm831x = wm831x; @@ -842,10 +836,8 @@ static int wm831x_epe_probe(struct platform_device *pdev) dev_dbg(pdev-dev, Probing EPE%d\n, id + 1); dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); - if (dcdc == NULL) { - dev_err(pdev-dev, Unable to allocate private data\n); + if (!dcdc) return -ENOMEM; - } dcdc-wm831x = wm831x; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 20/23] regulator: wm831x-dcdc: Remove redundant error message
On Thu, Feb 20, 2014 at 02:23:20PM +0530, Sachin Kamat wrote: kzalloc prints its own OOM message upon failure. Applied, thanks. signature.asc Description: Digital signature