diff options
author | Sebastian Reichel <sre@kernel.org> | 2023-03-17 23:57:00 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2023-03-29 22:38:57 +0200 |
commit | 2f25b9750fa0d79090cadf6e7d0e3edba4fa58e3 (patch) | |
tree | 7ff32a607c75e85d9ef9716579df98e8061f2a45 /drivers/power | |
parent | power: supply: generic-adc-battery: drop charge now support (diff) | |
download | linux-2f25b9750fa0d79090cadf6e7d0e3edba4fa58e3.tar.xz linux-2f25b9750fa0d79090cadf6e7d0e3edba4fa58e3.zip |
power: supply: generic-adc-battery: drop memory alloc error message
Error printing happens automatically for memory allocation problems.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/generic-adc-battery.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c index d07eeb7d46d3..771e5cfc49c3 100644 --- a/drivers/power/supply/generic-adc-battery.c +++ b/drivers/power/supply/generic-adc-battery.c @@ -243,10 +243,8 @@ static int gab_probe(struct platform_device *pdev) bool any = false; adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL); - if (!adc_bat) { - dev_err(&pdev->dev, "failed to allocate memory\n"); + if (!adc_bat) return -ENOMEM; - } psy_cfg.drv_data = adc_bat; psy_desc = &adc_bat->psy_desc; |