Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2366460rwd; Mon, 15 May 2023 10:36:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ovXSJrCRItuDIC9ZE+O9tt5QvBtAdVmfpQhZiqqD1zHh60K2dZsU6FWQiWjnzbDwYgvPL X-Received: by 2002:a05:6a20:160c:b0:102:a593:a162 with SMTP id l12-20020a056a20160c00b00102a593a162mr24384192pzj.4.1684172204690; Mon, 15 May 2023 10:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684172204; cv=none; d=google.com; s=arc-20160816; b=xCkQIej2G+IZ2QlUvjaRps39yCgSjASe1yWJUZqtDY0sVHEa+xjLkCF3IDYMma9YcM FoKE40DJAJYA1dG1DQx03XtH2DKm+4UbPTlGj5UguHcfOhgFzKEJexIHF2QszLqPQggG NvHGx3L48GeCHNk3J9Z2Es8k7j6yf16BopKd35wR+sNQg9nOQBdYmq0R64BLUVF44ztw jTBlUn6neDrnMc1SgVfhLlGkDNUIvhWC3Rcaw0H2WylSIHFBDFz3yfHiaR0QWr6g3s2p KYqgZ2xen77AoN3VPX+ZSGnNTUeL12DGqxkSU7HPpFHsVJYvaSRFe1G58B9gxbpN/IgR w1FA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Fz6acpVUz4kPc93Wpq7DpAV+sFsxdMkORJPc+9xniKI=; b=ZyK58UBU/Lv7mmkCAxhKzW6w33+/WCrJnqrZ0ZYkhUGJ8vEOTAC3G9wTv5GoxJLdsq Rto2VU9phWMaPR57xzoHiDNhF2pByYUMSAFik+yY3wTeXOzVgzdx9x4TyU/GPdQWe5Ue utaBsxzceOK6IHaardVSm+GfhYcr8P2aGmnRrwTZvpNO2mOmtH26ffoKkpn5xYey8jIw rtsHk55RvZMuVW+MhF7erIYNMRTG2xI04I3c1L2xDmepneoCzg9/Oa2E6pH/L0t7gD3K Vq7wrkV8SXi3/Mx2tVo4WhtH8cb9MP6cd5XHCopf8b2JGWCbQEb6mh+SFyuiAynXRel6 rVyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TYrpIHOb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020a63b555000000b0052877366da6si3125413pgo.104.2023.05.15.10.36.32; Mon, 15 May 2023 10:36:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TYrpIHOb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242011AbjEORdG (ORCPT + 99 others); Mon, 15 May 2023 13:33:06 -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-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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *rdev) } rdev->debugfs = 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 = class_register(®ulator_class); debugfs_root = debugfs_create_dir("regulator", NULL); - if (!debugfs_root) + if (IS_ERR(debugfs_root)) pr_warn("regulator: Failed to create debugfs directory\n"); #ifdef CONFIG_DEBUG_FS -- 2.34.1