From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (unknown [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD78E2C83 for ; Mon, 8 Nov 2021 10:12:41 +0000 (UTC) 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 100541EC0501; Mon, 8 Nov 2021 11:12:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366347; 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=nRs8Hwu0oLLsUo7HT1qzBFdIIrVvFV70O+h27c4scJI=; b=k0XF0Y4nVjzUo+96uDWhyD+qexJi5lhwEKmlAtzm0xq5K2QA/s1v8CS0X3OQxJhFPpkyFI sKueirlziAwcAeXkBh60Cl1U+AdW7woPc51BvNYDLSzUecr1BzLDOmH6SyYdt9PBSnW0vD fsKgB9zAWNVyDubPQDLYS6w+i8HC2gw= From: Borislav Petkov To: LKML Cc: linux-staging@lists.linux.dev Subject: [PATCH v0 24/42] staging: olpc_dcon: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:39 +0100 Message-Id: <20211108101157.15189-25-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> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Borislav Petkov Avoid homegrown notifier registration checks. No functional changes. Signed-off-by: Borislav Petkov Cc: linux-staging@lists.linux.dev --- drivers/staging/olpc_dcon/olpc_dcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 7284cb4ac395..f5204a88bb35 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -653,7 +653,9 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) } register_reboot_notifier(&dcon->reboot_nb); - atomic_notifier_chain_register(&panic_notifier_list, &dcon_panic_nb); + + if (atomic_notifier_chain_register(&panic_notifier_list, &dcon_panic_nb)) + pr_warn("Panic notifier already registered\n"); return 0; -- 2.29.2