Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6361407pxb; Mon, 8 Nov 2021 07:23:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRVJVPNjQVFu8oMXx186C+jo5HFvxO6GabsgoJPmj4XCLgX57QrILk3GBeuUKNwa7U5xBz X-Received: by 2002:a17:906:d9c8:: with SMTP id qk8mr149212ejb.306.1636385037686; Mon, 08 Nov 2021 07:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636385037; cv=none; d=google.com; s=arc-20160816; b=JgsVLZlp+1oP8F9517BkaqAaL6y5mWp1l/WWrCNtrMn9uBPJdAPbpLVLm/D4sVl3rN ODl/c8aL5dmjM0ZVhxKr7prAmb1u3mCYL32zCTMKccrcwh6+P7pxRSr6kZUXuke/couG RWEcBU1smbDS9vg2WO2fom2TdI5jfixbi2G/rkOHP2cZ4MIu05SAfOmiQF5agDSNceP5 ROHQaEoJyxgv94b5Z+PQft4GBLGlJflWyHQZBwc9OdodYMyl/mGxBSxvYBaSgOEwPX6o pOKrpw4rrHQpS5Jm6QPuxH+TQaznH2gBHAHPj75u9jx9iwxd+aVdeH1rapgOePcT0PQA 2/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0bmUspGRI3vuCuIzEtla9uRDSSAXdxTYEy3IVd3MVFs=; b=fPaBQz5w7n1thX5J2Er6VXdL5C4dXnjfYlaoeVBGftMAT2B2t2MexG7W9Fh4zBnxB5 U8dA5Mdrx1AmhY7JcParPrFDHSEjKzKHY5iLn0Y1vIC4zRYwTQpREe2czgco6GasjSBQ UD62092xWVAeFEryWenz2zTpDIT4abkXlHqrXhQqJZZp0zu0B0LEkoC8Xl5k9Z6e+sfK ko1GyRWYLwuiZWO2EmIngnwyfYp5WqT0ZzO3EtIFDeHw7GNUH2VMt8I8CHtA08WVhA1N N/kd6wO3mKmWxM38LkDoS09HpCd7DBYHFV3b95FZIMqlxvhvI7pyvbNjjUQg2jku3AXK AG1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BUCqB0bD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si26987010edr.120.2021.11.08.07.23.33; Mon, 08 Nov 2021 07:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BUCqB0bD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239090AbhKHKT2 (ORCPT + 99 others); Mon, 8 Nov 2021 05:19:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238648AbhKHKPj (ORCPT ); Mon, 8 Nov 2021 05:15:39 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5329BC061228; Mon, 8 Nov 2021 02:12:42 -0800 (PST) Received: from zn.tnic (p200300ec2f33110088892b77bd117736.dip0.t-ipconnect.de [IPv6:2003:ec:2f33:1100:8889:2b77:bd11:7736]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CF6231EC05B0; Mon, 8 Nov 2021 11:12:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bmUspGRI3vuCuIzEtla9uRDSSAXdxTYEy3IVd3MVFs=; b=BUCqB0bDjyvsSVFWoldZl8G9z6l/yU+oZd+AQAP9vsPEIgEqbFJl5K8CcnZI9x+iBhOB7V aSIJUJUIvfFl56W+sSbyZ685y4Q64T3nmFnFcG/7sOPjkJyzC9A33IMB0Iy+8H1PfQhimc rLYVuWJ4mNyKLgZ9s1JN5HSOX4T/dwE= From: Borislav Petkov To: LKML Cc: linux-pm@vger.kernel.org Subject: [PATCH v0 41/42] power: supply: ab8500: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:56 +0100 Message-Id: <20211108101157.15189-42-bp@alien8.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211108101157.15189-1-bp@alien8.de> References: <20211108101157.15189-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov Avoid homegrown notifier registration checks. No functional changes. Signed-off-by: Borislav Petkov Cc: linux-pm@vger.kernel.org --- drivers/power/supply/ab8500_charger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index 15eadaf46f14..de99f070cbc2 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3644,10 +3644,10 @@ static int ab8500_charger_probe(struct platform_device *pdev) } /* Notifier for external charger enabling */ - if (!di->ac_chg.enabled) - blocking_notifier_chain_register( - &charger_notifier_list, &charger_nb); - + if (!di->ac_chg.enabled) { + if (blocking_notifier_chain_register(&charger_notifier_list, &charger_nb)) + pr_warn("Charger notifier already registered\n"); + } di->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(di->usb_phy)) { -- 2.29.2