From patchwork Mon Dec 19 08:17:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9479839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B99360772 for ; Mon, 19 Dec 2016 08:18:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CDCE28457 for ; Mon, 19 Dec 2016 08:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717A62847F; Mon, 19 Dec 2016 08:18:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 054D32845E for ; Mon, 19 Dec 2016 08:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932849AbcLSIRw (ORCPT ); Mon, 19 Dec 2016 03:17:52 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:36100 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932899AbcLSIRu (ORCPT ); Mon, 19 Dec 2016 03:17:50 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIF000COB1DI870@mailout2.samsung.com>; Mon, 19 Dec 2016 17:17:42 +0900 (KST) X-AuditID: cbfee61b-f79d86d00000197e-a0-585797a678a1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id E3.05.06526.6A797585; Mon, 19 Dec 2016 17:17:42 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIF0068CB1HL410@mmp2.samsung.com>; Mon, 19 Dec 2016 17:17:42 +0900 (KST) From: Jaehoon Chung To: linux-pci@vger.kernel.org Cc: helgaas@google.com, krzk@kernel.org, linux-kernel@vger.kernel.org, jingoohan1@gmail.com, javier@osg.samsung.com, kgene@kernel.org, linux-samsung-soc@vger.kernel.org, cpgs@samsung.com, Jaehoon Chung Subject: [PATCH 4/4] PCI: exynos: remove the duplicated codes Date: Mon, 19 Dec 2016 17:17:40 +0900 Message-id: <20161219081740.5457-5-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20161219081740.5457-1-jh80.chung@samsung.com> References: <20161219081740.5457-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t9jQd1l08MjDLZ8kbN4eUjTYtbzPawW b96uYbK48auN1WLFl5nsFv2PXzNbnD+/gd3i8q45bBZn5x1ns5hxfh+TA5fHzll32T0WbCr1 2LSqk81jSz+Q17dlFaPH501yAWxRbjYZqYkpqUUKqXnJ+SmZeem2SqEhbroWSgp5ibmptkoR ur4hQUoKZYk5pUCekQEacHAOcA9W0rdLcMu4uLWk4D1vxdPuNuYGxqfcXYycHBICJhJTZq9h g7DFJC7cWw9mCwnMYpTY9NS7i5ELyP7BKLFx1TdWkASbgI7E9m/HmUBsEQFZiY+X94A1MAu8 YJT4vEwSxBYWsJX4+OUqUD0HB4uAqsSLj2AlvAJWEj/mHWGG2CUvsfD8EbAxnALWEtf3rGWF 2Gsl8XjuQ5YJjLwLGBlWMUqkFiQXFCel5xrlpZbrFSfmFpfmpesl5+duYgSH/DPpHYyHd7kf YhTgYFTi4Z3AHR4hxJpYVlyZe4hRgoNZSYTXcTJQiDclsbIqtSg/vqg0J7X4EKMp0F0TmaVE k/OB8ZhXEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZqakFqEUwfEwenVAOj6vwS5+u8 V7ZI7C+VKxbmW7zmoP2Ov3pxpddP3XwxkzVK7t+xrMs3Vfy95rE21RXMfh964nLkorWdnF+4 NiZvnOZ4+xX/l0eJq65yrN26POvYlYJDEjMPd8+7X3n9hPt+xZ//ky8bn3lp+d2e9xWn2QrB /Ox+yfY1zyZEz94vuP/GFx/ZR2/sviqxFGckGmoxFxUnAgBVbtVsjwIAAA== X-MTR: 20000000000000000@CPGS Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removed the duplicated codes. It can use the more simply than now. Signed-off-by: Jaehoon Chung Reviewed-by: Pankaj Dubey Acked-by: Krzysztof Kozlowski --- drivers/pci/host/pci-exynos.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c index d705bfe..33562cf 100644 --- a/drivers/pci/host/pci-exynos.c +++ b/drivers/pci/host/pci-exynos.c @@ -116,30 +116,24 @@ static void exynos_pcie_sideband_dbi_w_mode(struct exynos_pcie *ep, bool on) { u32 val; - if (on) { - val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_AWMISC); + val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_AWMISC); + if (on) val |= PCIE_ELBI_SLV_DBI_ENABLE; - exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_AWMISC); - } else { - val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_AWMISC); + else val &= ~PCIE_ELBI_SLV_DBI_ENABLE; - exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_AWMISC); - } + exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_AWMISC); } static void exynos_pcie_sideband_dbi_r_mode(struct exynos_pcie *ep, bool on) { u32 val; - if (on) { - val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_ARMISC); + val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_ARMISC); + if (on) val |= PCIE_ELBI_SLV_DBI_ENABLE; - exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_ARMISC); - } else { - val = exynos_pcie_readl(ep->elbi_base, PCIE_ELBI_SLV_ARMISC); + else val &= ~PCIE_ELBI_SLV_DBI_ENABLE; - exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_ARMISC); - } + exynos_pcie_writel(ep->elbi_base, val, PCIE_ELBI_SLV_ARMISC); } static void exynos_pcie_assert_core_reset(struct exynos_pcie *ep)