From nobody Tue Dec 16 16:43:04 2025 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 AC881C77B60 for ; Mon, 24 Apr 2023 02:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbjDXC7v (ORCPT ); Sun, 23 Apr 2023 22:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjDXC7t (ORCPT ); Sun, 23 Apr 2023 22:59:49 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AB8B2721 for ; Sun, 23 Apr 2023 19:59:43 -0700 (PDT) Received: from dd-virtual-machine.localdomain ([60.247.94.10]) (user=u202114568@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33O2verx030312-33O2ves0030312 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 24 Apr 2023 10:57:52 +0800 From: Yuchen Yang To: Liam Girdwood , Mark Brown , Stephen Boyd Cc: hust-os-kernel-patches@googlegroups.com, Yuchen Yang , Dongliang Mu , Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org Subject: [PATCH] drivers: regulator: core: remove return value check of `rdev->debugfs` Date: Mon, 24 Apr 2023 10:57:37 +0800 Message-Id: <20230424025738.34950-1-u202114568@hust.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FEAS-AUTH-USER: u202114568@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Smatch complains that: rdev_init_debugfs() warn: 'rdev->debugfs' is an error pointer or valid According to the documentation of the debugfs_create_dir() function,=20 there is no need to check the return value of this function. Just delete the dead code. Fixes: 247514344492 ("regulator: Remove ifdefs for debugfs code") Fixes: 1130e5b3ff4a ("regulator: Add initial per-regulator debugfs support") Signed-off-by: Yuchen Yang Reviewed-by: Dongliang Mu --- drivers/regulator/core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4fcd36055b02..979ee043f7a1 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5188,10 +5188,6 @@ static void rdev_init_debugfs(struct regulator_dev *= rdev) } =20 rdev->debugfs =3D debugfs_create_dir(rname, debugfs_root); - if (!rdev->debugfs) { - rdev_warn(rdev, "Failed to create debugfs directory\n"); - return; - } =20 debugfs_create_u32("use_count", 0444, rdev->debugfs, &rdev->use_count); --=20 2.25.1