From patchwork Mon Jan 16 06:31:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9518093 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 CD2756020B for ; Mon, 16 Jan 2017 06:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8297E28342 for ; Mon, 16 Jan 2017 06:32:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7756C28387; Mon, 16 Jan 2017 06:32:22 +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=unavailable 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 26CED28342 for ; Mon, 16 Jan 2017 06:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751344AbdAPGby (ORCPT ); Mon, 16 Jan 2017 01:31:54 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:42378 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750845AbdAPGbs (ORCPT ); Mon, 16 Jan 2017 01:31:48 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV01HMJ0SU8T20@mailout2.samsung.com>; Mon, 16 Jan 2017 15:31:42 +0900 (KST) Received: from epsmges1p1.samsung.com (unknown [182.195.40.70]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116063142epcas1p1ddfed97b7b188f731a8098e02610503e~aLNDNxpNu2704527045epcas1p17; Mon, 16 Jan 2017 06:31:42 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 48.95.08225.EC86C785; Mon, 16 Jan 2017 15:31:42 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170116063142epcas1p32d52a367a66410206b3ddb4149fde079~aLNC7AHLY0434804348epcas1p3k; Mon, 16 Jan 2017 06:31:42 +0000 (GMT) X-AuditID: b6c32a35-f79956d000002021-0d-587c68ce96fe Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id AA.B5.08931.EC86C785; Mon, 16 Jan 2017 15:31: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 <0OJV00DGH0SSQ5A0@mmp2.samsung.com>; Mon, 16 Jan 2017 15:31:42 +0900 (KST) From: Jaehoon Chung To: linux-pci@vger.kernel.org Cc: bhelgaas@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 V3 5/5] PCI: exynos: remove the duplicated codes Date: Mon, 16 Jan 2017 15:31:38 +0900 Message-id: <20170116063138.25805-6-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20170116063138.25805-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIKsWRmVeSWpSXmKPExsWy7bCmru65jJoIg69/pS2WNGVYvDykafHm 7Romixu/2lgtVnyZyW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zVMFjd+tbFarPgyk92i//FrZovz5zewW1zeNYfN4uy842wWM87vY3Lg8tg56y67x4JNpR6b VnWyeWzpB/L6tqxi9Pi8SS6ALcrNJiM1MSW1SCE1Lzk/JTMv3VYpNMRN10JJIS8xN9VWKULX NyRISaEsMacUyDMyQAMOzgHuwUr6dgluGWeXzmIs6OKvmH7HooHxBU8XIyeHhICJxL5bK1kh bDGJC/fWs3UxcnEICcxilPh9v5sFwvnBKLG5bzUjSBWbgI7E9m/HmUBsEQFZiY+X94B1MAu8 ZJToOP+BBSQhLOAg0dL+jw3EZhFQlbgzfwYziM0rYC2xb10LE8Q6eYmF54+A2ZwCNhKTDywH qxECqtnddZ5pAiPvAkaGVYwSqQXJBcVJ6bmGeanlesWJucWleel6yfm5mxjBYf9MagfjwV3u hxgFOBiVeHgX7KiOEGJNLCuuzD3EKMHBrCTCOzGlJkKINyWxsiq1KD++qDQntfgQoynQYROZ pUST84ExmVcSb2hibmJubGBhbmlpYqQkzts4+1m4kEB6YklqdmpqQWoRTB8TB6dUA+P6mGON 6ZpXaiYc8OTuquAy/trDy7rGhkuSz/JOzJxXJkfUreY9Vs32b7q07uE6lzdXl2lv217ZEW7o mWeszHH3+qStHcZputt9vz0J/bPQMvWD4ttCH/F5MadFZnMX2/6uurkyq8vpi+bu/sZzLmI6 8q7/Lse9EGI859UZ5C7y4Pym3hvd05RYijMSDbWYi4oTAXMkqB2RAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116063142epcas1p32d52a367a66410206b3ddb4149fde079 X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 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: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170116063142epcas1p32d52a367a66410206b3ddb4149fde079 X-RootMTR: 20170116063142epcas1p32d52a367a66410206b3ddb4149fde079 References: <20170116063138.25805-1-jh80.chung@samsung.com> 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 Reviewed-by: Pankaj Dubey Acked-by: Krzysztof Kozlowski --- Changelog on V3: - None 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 c5892c2..faee7d3 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)