From patchwork Wed Feb 3 07:01:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12063515 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AD78C433E6 for ; Wed, 3 Feb 2021 07:04:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AA5864F60 for ; Wed, 3 Feb 2021 07:04:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbhBCHDg (ORCPT ); Wed, 3 Feb 2021 02:03:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:35486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232012AbhBCHDY (ORCPT ); Wed, 3 Feb 2021 02:03:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 792C864E30; Wed, 3 Feb 2021 07:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612335720; bh=4knJo6OkRBqQrTR3UVhhAX+TpSaav9x8tCsbL69SdgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngLI2w461tDcIne3RSvMw0lQtKF989ppIZFq3V28daW4JQJPpye4OFF3+figBnpb0 0X8US8qw/bACXvBQHvkkXNdKW6EGOf+y1b9MFK9UxdH/KdAo5CiMwniKKpLknxa8jq YNjNiOn/HwLKfz2+PeeV/5ovLKHuJ3bDHwqJ6XGwPeLPZynxwnSSnYuSXRK4sb0Kho ruCohXIFQVGP9SKRX1cxY9J5/zTK7/tZLkjWRriL7FDAc4qzjHfNRS6Jxonu1DrFWP Q4eR+mHh53232YVGdy6l3Ule3UtSFleQ+qKki6omhiQJLkMSGt5hdx7bztbEDdgbGg AQiqovtODnMqA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1l7CAo-001CAn-AU; Wed, 03 Feb 2021 08:01:58 +0100 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Binghui Wang , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Xiaowei Song , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 11/11] pci: dwc: pcie-kirin: cleanup kirin970_pcie_get_eyeparam() Date: Wed, 3 Feb 2021 08:01:55 +0100 Message-Id: <1584b35df936f50bb3187c233b9110c53652a518.1612335031.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Cleanup the routine, to let it clearer that eye_param is optional and that, if not specified, the driver will assume the default. While here, also drop the useless debug prints. Signed-off-by: Mauro Carvalho Chehab --- drivers/pci/controller/dwc/pcie-kirin.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c index c5404f1eca28..88f10aff8b09 100644 --- a/drivers/pci/controller/dwc/pcie-kirin.c +++ b/drivers/pci/controller/dwc/pcie-kirin.c @@ -246,21 +246,18 @@ static long kirin_pcie_get_clk(struct kirin_pcie *kirin_pcie, void kirin970_pcie_get_eyeparam(struct kirin_pcie *pcie) { struct device *dev = pcie->pci->dev; - int i; struct device_node *np; + int ret, i; np = dev->of_node; - if (of_property_read_u32_array(np, "eye_param", pcie->eye_param, 5)) { - for (i = 0; i < 5; i++) + ret = of_property_read_u32_array(np, "eye_param", pcie->eye_param, 5); + if (!ret) + return; + + /* There's no optional eye_param property. Set array to default */ + for (i = 0; i < 5; i++) pcie->eye_param[i] = EYEPARAM_NOCFG; - } - - dev_dbg(dev, "eye_param_vboost = [0x%x]\n", pcie->eye_param[0]); - dev_dbg(dev, "eye_param_iboost = [0x%x]\n", pcie->eye_param[1]); - dev_dbg(dev, "eye_param_pre = [0x%x]\n", pcie->eye_param[2]); - dev_dbg(dev, "eye_param_post = [0x%x]\n", pcie->eye_param[3]); - dev_dbg(dev, "eye_param_main = [0x%x]\n", pcie->eye_param[4]); } static void kirin970_pcie_set_eyeparam(struct kirin_pcie *kirin_pcie)