From patchwork Wed Jul 17 11:58:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 13735430 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F47CC3DA42 for ; Wed, 17 Jul 2024 12:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=kcTlzdSbCPYBa7vAri6YqB9ZoXDHn//E8DaLgVTWQzY=; b=hfLxfg/NRThR48K2M9p+ClnyWM NRNsIQRBh3+oFwGd2DKEX+rAMutk2e96g+/a2tbA6fWL1fSrSxTXnSA5MM48QZ5H8hTQ7kn3WX4sQ NNqF4CxYR5C8fmHltN2+Mndz5E7cVVfF4gAT7+gbNBZ1Kds9OGI/HtkFPCzOTQT8AlnhGnNnFxCDA mV3Su2rmz5b7F+a93+owz1rTcr/58hOf6Py+EpibQXNS+0Eit4AQBQFa4TlH1ApoZeWhvrNhu8g2v 3Sba1D+Py0DDnmL8RCj0Y/L7ONstjUCSNKhv5piSKL6iKKLZctfETVdgcKcRpXMYtewboI79FdRN+ UpRSIWFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sU3Jz-0000000Dh1u-2uzZ; Wed, 17 Jul 2024 11:59:47 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sU3Jf-0000000Dgwt-0n6p for linux-arm-kernel@lists.infradead.org; Wed, 17 Jul 2024 11:59:29 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2c95ca60719so4455739a91.3 for ; Wed, 17 Jul 2024 04:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1721217565; x=1721822365; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kcTlzdSbCPYBa7vAri6YqB9ZoXDHn//E8DaLgVTWQzY=; b=nnRvwnNwpgLKPTQPNYeyUw0U63c8xYYumhdIkejd6ycTuud6LIURmKpAk7ROfbG257 YKe8oNA/hjOFd8+XDsJtHs6jdoknp9guPT9w9bLMNTp0UbyNxIWwhfE916D1Aewz5o/S aI8U+QXLQUULV5s6ZjxCPGvBnndLeqFh3dyek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721217565; x=1721822365; 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=kcTlzdSbCPYBa7vAri6YqB9ZoXDHn//E8DaLgVTWQzY=; b=EidJNYRSxr1ivpDm865SnPdWF+F33wW6UbNLkgmT35OygHm+Dfpha0+EbH+zRA7S60 jioUzX5M7O6sKhjNIb3M4ArAbQocgK9QpfpUtdmT6jmAPgCeWFAGqSzKJg51On5jVylH TRQ1ADU1UqB1wEUVWjjGppOnVEm3B6knyWYXveR4/bsE1iZ37zjeoY9ZrKvWFG84YzMH nsEn5vb85Qbvq35rSZJDiuH2xd1oXvDV0xjb7Pm9CKCziyRYiI3oL1OpBDQCq6yP2/Jo r9fK96B6iagn3MZng2IZZtff+rvH1XaWsTcxCnkagIEFFIXR4rw9wXPklATUncCkIeMC WhDA== X-Forwarded-Encrypted: i=1; AJvYcCXPrF1Ixf4T2fQ8FBC4rYnrvesIh3mztOxMlh6McpPatrUcwF/ASPmXBuY4GJNnVI1Lmjrao3it1NGs+X8BavLoyynwaqVP9tX6jtAdd+mEWl1KDrA= X-Gm-Message-State: AOJu0Yxk3DH/jIGFNcy5mrRtjHT/IXQXj9MqVgkbsPC5ZnzwWuxjrKSU Vn6AZ70hxxWA85IDcX6sjO+zkGE34ocp/hFAHtd85/0v1PQ1+eqjHydVjFQ1Hw== X-Google-Smtp-Source: AGHT+IE8xpZ5IZDUMHdNrgUQW2/WR8g1HkPeRhtTiLALcp2Xt/UQv21YSG9GEN31UQfbsAOI8lOinw== X-Received: by 2002:a17:90a:c7d1:b0:2cb:5654:8367 with SMTP id 98e67ed59e1d1-2cb56548442mr722546a91.26.1721217565184; Wed, 17 Jul 2024 04:59:25 -0700 (PDT) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:97dd:ecf:8796:54cd]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cacd41a01asm10006858a91.32.2024.07.17.04.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jul 2024 04:59:24 -0700 (PDT) From: Fei Shao To: AngeloGioacchino Del Regno , Stephen Boyd Cc: Fei Shao , Matthias Brugger , Michael Turquette , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH] clk: mediatek: reset: Return regmap's error code Date: Wed, 17 Jul 2024 19:58:52 +0800 Message-ID: <20240717115919.975474-1-fshao@chromium.org> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240717_045927_269209_20ECCBBB X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org device_node_to_regmap() can return different errors, and it's better practice to pass them to callers. Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead. Signed-off-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno --- drivers/clk/mediatek/reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c index 290ceda84ce4..f8c0fd031512 100644 --- a/drivers/clk/mediatek/reset.c +++ b/drivers/clk/mediatek/reset.c @@ -138,7 +138,7 @@ int mtk_register_reset_controller(struct device_node *np, regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) { pr_err("Cannot find regmap for %pOF: %pe\n", np, regmap); - return -EINVAL; + return PTR_ERR(regmap); } data = kzalloc(sizeof(*data), GFP_KERNEL); @@ -198,7 +198,7 @@ int mtk_register_reset_controller_with_dev(struct device *dev, regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) { dev_err(dev, "Cannot find regmap %pe\n", regmap); - return -EINVAL; + return PTR_ERR(regmap); } data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);