From patchwork Thu Jan 12 02:17:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9511799 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 5DD59607D2 for ; Thu, 12 Jan 2017 02:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D68E2869C for ; Thu, 12 Jan 2017 02:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41841286AA; Thu, 12 Jan 2017 02:18:41 +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 D6731286A7 for ; Thu, 12 Jan 2017 02:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964941AbdALCSL (ORCPT ); Wed, 11 Jan 2017 21:18:11 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:36167 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbdALCR1 (ORCPT ); Wed, 11 Jan 2017 21:17:27 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJN01MEJACZ6SD0@mailout4.samsung.com>; Thu, 12 Jan 2017 11:17:23 +0900 (KST) Received: from epsmges5p5.samsung.com (unknown [182.195.40.65]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20170112021722epcas1p2f4cf87bf4d54b2bfcda1b77615b44e3e~Y5J2nNorK0532705327epcas1p2L; Thu, 12 Jan 2017 02:17:22 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p5.samsung.com (EPCPMTA) with SMTP id 5C.0B.27948.237E6785; Thu, 12 Jan 2017 11:17:22 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20170112021722epcas5p483ea584341324ad650a1d7fbe9a76793~Y5J2WxmJ23271732717epcas5p4m; Thu, 12 Jan 2017 02:17:22 +0000 (GMT) X-AuditID: b6c32a59-f79c56d000006d2c-01-5876e73258ad Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 23.C5.26370.237E6785; Thu, 12 Jan 2017 11:17:22 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJN00EIWACXY0B0@mmp1.samsung.com>; Thu, 12 Jan 2017 11:17:22 +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 V2 4/4] PCI: exynos: remove the duplicated codes Date: Thu, 12 Jan 2017 11:17:19 +0900 Message-id: <20170112021719.24986-4-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20170112021719.24986-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEKsWRmVeSWpSXmKPExsWy7bCmlq7R87IIg77VFhYvD2lazHq+h9Xi zds1TBY3frWxWqz4MpPdov/xa2aL8+c3sFt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/7Hr5ktzp/fwG5xedccNouz846zWcw4v4/Jgctj56y77B4LNpV6 bFrVyeaxpR/I69uyitHj8ya5ALYoN5uM1MSU1CKF1Lzk/JTMvHRbpdAQN10LJYW8xNxUW6UI Xd+QICWFssScUiDPyAANODgHuAcr6dsluGX07zMu+MRXcXvRC5YGxqs8XYycHBICJhJ3p6xj g7DFJC7cWw9mCwksZZSYtoYRwv7BKDF7XgyIzSagI7H923EmEFtEQFbi4+U9YPXMAi8YJT4v kwSxhQUcJPoadoHVsAioSrxa/Iyli5GDg1fAWuLOVlOIVfISC88fASvhFLCRWLdmKwvEKmuJ k4vOsk5g5F3AyLCKUSK1ILmgOCk91ygvtVyvODG3uDQvXS85P3cTIzjgn0nvYDy8y/0QowAH oxIPL8Pxsggh1sSy4srcQ4wSHMxKIry6T4BCvCmJlVWpRfnxRaU5qcWHGE2B7prILCWanA+M xrySeEMTcxNzYwMLc0tLEyMlcd7G2c/ChQTSE0tSs1NTC1KLYPqYODilGhjFYzLUYu7rlicW 9bG+cM6r1lbdP/Xq6aIf0Y8ZJYsuxE2fJTgpxoWfvfv1ipo5Z4/oXP6lLLPzp1hzCINx8q5j udu4mQvfxbHtz9Xr/LxEb/ule5GFjXahbfJ6d3+0X5o0ffpT5XVbZ3xtWOpwWOX9qqmn+ETd ezL6g4zd5Xdm3zq0YNleWS0lluKMREMt5qLiRAAn6TgDjgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170112021722epcas5p483ea584341324ad650a1d7fbe9a76793 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?7KCV7J6s7ZuIG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzUo7LGF7J6EKS/ssYXsnoQ=?= X-Global-Sender: =?UTF-8?B?SmFlaG9vbiBDaHVuZxtUaXplbiBQbGF0Zm9ybSBMYWIuG1Nh?= =?UTF-8?B?bXN1bmcgRWxlY3Ryb25pY3MbUzUvU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170112021722epcas5p483ea584341324ad650a1d7fbe9a76793 X-RootMTR: 20170112021722epcas5p483ea584341324ad650a1d7fbe9a76793 References: <20170112021719.24986-1-jh80.chung@samsung.com> 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 --- Changelog on V2: - None 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 6cbc1cc..a558fa1 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)