From patchwork Tue Mar 14 22:55:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 663118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AA3AC6FD1D for ; Tue, 14 Mar 2023 22:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230007AbjCNWz4 (ORCPT ); Tue, 14 Mar 2023 18:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbjCNWzr (ORCPT ); Tue, 14 Mar 2023 18:55:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A9523E60D; Tue, 14 Mar 2023 15:55:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D2255B81BFD; Tue, 14 Mar 2023 22:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71978C4339B; Tue, 14 Mar 2023 22:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678834542; bh=yPzVoyb/Gfy3GbgXbS/xEPN0qDCVRKIVaWj3y97xOno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dbkrJl8Um/67y1V8O9IC2TYKYe9FNx3Etd6CgWjefe353hRY6L6/jx/ng9EIre2Mo d/kjROV1i/Z1PRej2poOfRwXOuN0MhSWvtAzfAPYC9/74dplgETKRveYRygyuYo5kQ ZliBzSJLNn3T3HBsCwW0IBCRW9OXgS+Tw8kyJp1N83HPOW0lsC7jOJbzluBqefZGBW NsNid6xSPJxWAeHHBenfWjUiti99lkD5NomB9UZRqHqBa0QNgM7w7UHp3VoWXamuhu weIQ04dR6YdTDK1lS3IbbGr0KbE19wehMgrmH/ohGsjSFBadiXtZGejrd+62J36A66 q/vLvFzkMnEOQ== Received: by mercury (Postfix, from userid 1000) id DFE5210620AA; Tue, 14 Mar 2023 23:55:36 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel Cc: Linus Walleij , Matti Vaittinen , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCHv2 07/12] power: supply: generic-adc-battery: drop memory alloc error message Date: Tue, 14 Mar 2023 23:55:30 +0100 Message-Id: <20230314225535.1321736-8-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314225535.1321736-1-sre@kernel.org> References: <20230314225535.1321736-1-sre@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Error printing happens automatically for memory allocation problems. Reviewed-by: Linus Walleij Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel --- drivers/power/supply/generic-adc-battery.c | 4 +--- 1 file changed, 1 insertion(+), 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;