Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932974AbcLSIRx (ORCPT ); Mon, 19 Dec 2016 03:17:53 -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 X-AuditID: cbfee61b-f79d86d00000197e-a0-585797a678a1 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 53 Removed the duplicated codes. It can use the more simply than now. Signed-off-by: Jaehoon Chung --- 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) -- 2.10.2