From patchwork Mon Dec 19 08:16:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9479819 X-Patchwork-Delegate: bhelgaas@google.com 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 0FB4660772 for ; Mon, 19 Dec 2016 08:16:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F6C28457 for ; Mon, 19 Dec 2016 08:16:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7DB628474; Mon, 19 Dec 2016 08:16:53 +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 858ED2845E for ; Mon, 19 Dec 2016 08:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbcLSIQe (ORCPT ); Mon, 19 Dec 2016 03:16:34 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:39068 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178AbcLSIQ0 (ORCPT ); Mon, 19 Dec 2016 03:16:26 -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 <0OIF02XBUAYX0M90@mailout2.samsung.com>; Mon, 19 Dec 2016 17:16:17 +0900 (KST) X-AuditID: cbfee61b-f79d86d00000197e-09-585797504fbc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 4A.E4.06526.05797585; Mon, 19 Dec 2016 17:16:17 +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 <0OIF0065CAZ4L410@mmp2.samsung.com>; Mon, 19 Dec 2016 17:16:16 +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, Jaehoon Chung Subject: [PATCH 4/4] PCI: exynos: remove the duplicated codes Date: Mon, 19 Dec 2016 17:16:14 +0900 Message-id: <20161219081614.5403-5-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20161219081614.5403-1-jh80.chung@samsung.com> References: <20161219081614.5403-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRmVeSWpSXmKPExsVy+t9jQd3A6eERBq3bmC1mPd/DavHm7Rom ixu/2lgtVnyZyW7R//g1s8X58xvYLS7vmsNmcXbecTaLGef3MTlweuycdZfdY8GmUo9NqzrZ PLb0A3l9W1YxenzeJBfAFuVmk5GamJJapJCal5yfkpmXbqsUGuKma6GkkJeYm2qrFKHrGxKk pFCWmFMK5BkZoAEH5wD3YCV9uwS3jItbSwre81Y87W5jbmB8yt3FyMkhIWAi0XZ2IxuELSZx 4d56MFtIYBajxOwXZl2MXED2D0aJK+2zwBJsAjoS278dZwKxRQRkJT5e3sMGUsQscIVR4unc AywgCWEBW4mPX66ygtgsAqoSm87dAbI5OHgFrCQu7NKCWCYvsfD8EbA5nALWEhMXf2CGWGwl sXb1BeYJjLwLGBlWMUqkFiQXFCel5xrlpZbrFSfmFpfmpesl5+duYgQH+zPpHYyHd7kfYhTg YFTi4Z3AHR4hxJpYVlyZe4hRgoNZSYTXcTJQiDclsbIqtSg/vqg0J7X4EKMp0F0TmaVEk/OB kZhXEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZqakFqEUwfEwenVANjoGH1wrLOnGOZ d+87CrHP3aRVdfOPXVCP3P6/8XxbDArmHdyqr/dd5LrEiYr414tPLkwp2JB0Vvfh5Gkh63cc Kd26oU5lAkdNxeT4+Tkhz2XWG6xTU33lcTFp6sT1nvEN6wv2S+g+fKPaaWywUPVN34yDCxRN s54dmRSzKIqxJ+2U0q11XdIySizFGYmGWsxFxYkADyEhLowCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 --- 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)