Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp352449pxb; Thu, 14 Jan 2021 07:30:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYINAHnwoSuW4Vwra4R8OLmjeUeKkp0G7k7dIGJ0i/YpQqv4ifw2YRSsnAvdtwhVgyFtBc X-Received: by 2002:a17:906:c087:: with SMTP id f7mr5694267ejz.492.1610638249517; Thu, 14 Jan 2021 07:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610638249; cv=none; d=google.com; s=arc-20160816; b=KNoK69owmVg/hfXBnVK+a6iaIcqf0IcRG3DSWid67m9Qt6H8UrWqQCnauAkY3Bx65n 5C/+50RZF7OrBjPtRHXaUm0pi7oOVSroWCpFiGKfGm2jn+GabB+Y/UcPVXTqjtOKLn6L WPjs4CHoZrAFbczfVASiljBP/c8WIts09zPh9r6/gBGpSSrHcWszJtX1Hlna1+EurRk/ FaVoOCQci0EvXcOLOl0bRD+VbdRwQ6ngrzpEP/sTmKHbHmnV9rLHhjyUmdlhXVr5luMX CwPtIBnMVtAk4/xYu3MeLdr+ui5MWCghW6vhnnvI018Oi5iaNTFAZd0IaSBLiYiWNS9r E6eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=ZeknuUAYf7sa7FiQj8Bd8dqMv2t292XO8p9+4qiQOes=; b=w2MRC55BridI7DXfAUrJdgCJ69MFJvdMz/qxWFVBAXDd0FOu9kNeFgc8A932qqNsXB F4B2B+per5KDeBIihEFS5rpjl10X1Hv3idUIWhINJ8egbfZFL9X4qejsA4p8mrm2JZ05 1aDtyttNcmO/ZumHOSe2Uh5dd3lqcKaay0ApL/q328BF+7xWBh3hRCne9EoYIESsox7T hdjb++KylgtUWu3SSHUrLcpDYA/WWL9nC9o4mck6kH9MCYfbrQuApuCT4rMLfrj/GpAF h3urOlEbfNFA2NF+lJGNGql+dYnKCqQUh64Igh2mf7QxdiNGYCD4Elq3jLvBWPB9K16X YTbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si2470975ejy.309.2021.01.14.07.30.24; Thu, 14 Jan 2021 07:30:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729300AbhANP31 (ORCPT + 99 others); Thu, 14 Jan 2021 10:29:27 -0500 Received: from mga14.intel.com ([192.55.52.115]:7042 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbhANP30 (ORCPT ); Thu, 14 Jan 2021 10:29:26 -0500 IronPort-SDR: ny2TLsjmy9KAIHqP2YEUjAFWBm33A40eM016NOSj4wAcYYaVVZL9sO74QluTaz3ZAcasv+R3I4 897mjE8lAhxw== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="177604665" X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="177604665" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2021 07:28:40 -0800 IronPort-SDR: AS4mNqcG2wk0u/TRvfh3ApX4GNMKKeXCY4BWJ+XTA7Wbp0wZ6PhBB93B9NHTMO/sliAJowc5YK gz9HqozVd8Vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="568193603" Received: from zulkifl3-ilbpg0.png.intel.com ([10.88.229.114]) by orsmga005.jf.intel.com with ESMTP; 14 Jan 2021 07:28:37 -0800 From: Muhammad Husaini Zulkifli To: ulf.hansson@linaro.org, broonie@kernel.org, lgirdwood@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, adrian.hunter@intel.com, michal.simek@xilinx.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: andriy.shevchenko@intel.com, Rashmi.A@intel.com, mahesh.r.vaidya@intel.com, muhammad.husaini.zulkifli@intel.com Subject: [PATCH v1 4/9] mmc: sdhci-of-arasan: Use dev_err_probe() to avoid spamming logs Date: Thu, 14 Jan 2021 23:26:55 +0800 Message-Id: <20210114152700.21916-5-muhammad.husaini.zulkifli@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210114152700.21916-1-muhammad.husaini.zulkifli@intel.com> References: <20210114152700.21916-1-muhammad.husaini.zulkifli@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using dev_err_probe() can avoid spamming logs when probe is deferred. This function can also help to reduce code the size, uniform error handling and simplify the code. Signed-off-by: Muhammad Husaini Zulkifli Acked-by: Adrian Hunter Acked-by: Andy Shevchenko --- drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 4e6ee9e69a1b..585ca32ff330 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -1545,15 +1545,14 @@ static int sdhci_arasan_probe(struct platform_device *pdev) sdhci_arasan->clk_ahb = devm_clk_get(dev, "clk_ahb"); if (IS_ERR(sdhci_arasan->clk_ahb)) { - dev_err(dev, "clk_ahb clock not found.\n"); - ret = PTR_ERR(sdhci_arasan->clk_ahb); + ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb), + "clk_ahb clock not found.\n"); goto err_pltfm_free; } clk_xin = devm_clk_get(dev, "clk_xin"); if (IS_ERR(clk_xin)) { - dev_err(dev, "clk_xin clock not found.\n"); - ret = PTR_ERR(clk_xin); + ret = dev_err_probe(dev, PTR_ERR(clk_xin), "clk_xin clock not found.\n"); goto err_pltfm_free; } @@ -1606,8 +1605,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret = mmc_of_parse(host->mmc); if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "parsing dt failed (%d)\n", ret); + ret = dev_err_probe(dev, ret, "parsing dt failed.\n"); goto unreg_clk; } @@ -1615,8 +1613,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (of_device_is_compatible(np, "arasan,sdhci-5.1")) { sdhci_arasan->phy = devm_phy_get(dev, "phy_arasan"); if (IS_ERR(sdhci_arasan->phy)) { - ret = PTR_ERR(sdhci_arasan->phy); - dev_err(dev, "No phy for arasan,sdhci-5.1.\n"); + ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->phy), + "No phy for arasan,sdhci-5.1.\n"); goto unreg_clk; } -- 2.17.1