From nobody Mon Feb 9 15:59:26 2026 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 9858BC7EE23 for ; Mon, 15 May 2023 17:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244220AbjEORdJ (ORCPT ); Mon, 15 May 2023 13:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244363AbjEORcm (ORCPT ); Mon, 15 May 2023 13:32:42 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A2BDD8A for ; Mon, 15 May 2023 10:30:15 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-643990c5319so9449595b3a.2 for ; Mon, 15 May 2023 10:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684171814; x=1686763814; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Fz6acpVUz4kPc93Wpq7DpAV+sFsxdMkORJPc+9xniKI=; b=TYrpIHObAw0kzPfEsnuwqQyOu1/BCuubh1hUcVGmOlFkgXdfujmAdjFHAgHuLI9RJm /BEsCNaINosoxZFMJPI5wr9mSysPp7VuiJnFqw16DesJDfuKVYB9epBBTr5ZgipvNpSM Ann7mnJSxtN+cYt2L+tMve5UJ+zvB3FtMdTKDdscYtpYQ6dVoJdk3gUtSuhj5czbZ/te UPtRxKOdJw8PtqW10P3QSvAEoR9LzauNIXFAx4a+do5VjOr9jn1BdsfKtdwI24ybVOdt cbScidEI8XOcidq5y8hxlwT0w1ozO/hwbW8kKmmOXIp3ma/VMoROH1xDfungQ9U7Cd0l d9jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684171814; x=1686763814; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Fz6acpVUz4kPc93Wpq7DpAV+sFsxdMkORJPc+9xniKI=; b=g8W8RdHlGXM3jcnpB5UHo0kRUF08vf3Lgomw0CIv8BY0n2vA3WVnLXGwzREA4syAI3 NT1XVrlxUzY9ATiOsTdV3Ag1laDt1F32kAPzPVYsTZw0JrsQRBaviRWmFzkrqL50El9i yX8X8T1Hfb1uRJ1hV1aBwwLcJc0hZXjBEK9PXGcCUYhIcoWw1zCnzOujidIcuw8Q20bC Rimtni8MJWPZtDE+uIXg9s5kvy+Zf+b0PVZmDqWYnHrENkdMvrI66F+CDoFY9q0P5hUi 6Y31LgpwgWJ3BLHdmFCgnb4rVGZfvHi3PK0HsK8IqOHLw7b5qdwDXrlbAJaf2mBkFFds eERA== X-Gm-Message-State: AC+VfDxKYCGozoTHk4oYROTgZAwxoyKRRwkig8Yn3dPXHRV6Kt6PFrLf ghh/utudMca1ju/xydz+Oxw= X-Google-Smtp-Source: ACHHUZ4hKhXIiIdnwGGZ9sJZTgo6o/C9CJiZkEPuqAEtultZ1jIVTARvvy1E4dfH7lenUE6HDdPW+Q== X-Received: by 2002:a05:6a00:acc:b0:63b:435f:134a with SMTP id c12-20020a056a000acc00b0063b435f134amr44408367pfl.28.1684171814146; Mon, 15 May 2023 10:30:14 -0700 (PDT) Received: from Osmten.. ([103.84.150.77]) by smtp.gmail.com with ESMTPSA id y9-20020a62b509000000b0064ca1fa843fsm2575177pfe.62.2023.05.15.10.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 10:30:13 -0700 (PDT) From: Osama Muhammad To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Ivan Orlov Subject: [PATCH] regulator:core.c: Fix error checking for debugfs_create_dir Date: Mon, 15 May 2023 22:29:38 +0500 Message-Id: <20230515172938.13338-1-osmtendev@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch fixes the error checking in core.c in debugfs_create_dir. The correct way to check if an error occurred is 'IS_ERR' inline function. Signed-off-by: Osama Muhammad Suggested-by: Ivan Orlov --- drivers/regulator/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index dc741ac156c3..698ab7f5004b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5256,7 +5256,7 @@ static void rdev_init_debugfs(struct regulator_dev *r= dev) } =20 rdev->debugfs =3D debugfs_create_dir(rname, debugfs_root); - if (!rdev->debugfs) { + if (IS_ERR(rdev->debugfs)) { rdev_warn(rdev, "Failed to create debugfs directory\n"); return; } @@ -6178,7 +6178,7 @@ static int __init regulator_init(void) ret =3D class_register(®ulator_class); =20 debugfs_root =3D debugfs_create_dir("regulator", NULL); - if (!debugfs_root) + if (IS_ERR(debugfs_root)) pr_warn("regulator: Failed to create debugfs directory\n"); =20 #ifdef CONFIG_DEBUG_FS --=20 2.34.1