From: <honghui.zhang@mediatek.com>
To: <bhelgaas@google.com>, <matthias.bgg@gmail.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <linux-pci@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<yingjoe.chen@mediatek.com>, <eddie.huang@mediatek.com>,
<ryder.lee@mediatek.com>
Cc: <honghui.zhang@mediatek.com>, <hongkun.cao@mediatek.com>,
<youlin.pei@mediatek.com>, <yong.wu@mediatek.com>,
<yt.shen@mediatek.com>, <sean.wang@mediatek.com>,
<xinping.qian@mediatek.com>
Subject: [PATCH v2 2/3] PCI: mediatek: take use of bus->sysdata to get host private data
Date: Mon, 14 Aug 2017 21:04:27 +0800 [thread overview]
Message-ID: <1502715868-17651-3-git-send-email-honghui.zhang@mediatek.com> (raw)
In-Reply-To: <1502715868-17651-1-git-send-email-honghui.zhang@mediatek.com>
From: Honghui Zhang <honghui.zhang@mediatek.com>
Commit ae02a6dda285 ("PCI: mediatek: Add controller support for MT2712 and
MT7622") has put the mtk_pcie * into bus->sysdata, take advantage of that
to get the private data and simplify the code.
Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
---
drivers/pci/host/pcie-mediatek.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
index 946c056..acc2e28 100644
--- a/drivers/pci/host/pcie-mediatek.c
+++ b/drivers/pci/host/pcie-mediatek.c
@@ -511,8 +511,7 @@ static int mtk_pcie_setup_irq(struct mtk_pcie_port *port,
static void __iomem *mtk_pcie_map_bus(struct pci_bus *bus,
unsigned int devfn, int where)
{
- struct pci_host_bridge *host = pci_find_host_bridge(bus);
- struct mtk_pcie *pcie = pci_host_bridge_priv(host);
+ struct mtk_pcie *pcie = bus->sysdata;
writel(PCIE_CONF_ADDR(where, PCI_FUNC(devfn), PCI_SLOT(devfn),
bus->number), pcie->base + PCIE_CFG_ADDR);
--
2.6.4
next prev parent reply other threads:[~2017-08-14 13:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-14 13:04 [PATCH v2 0/3] PCI: mediatek: Add MSI support for MT2712 and MT7622 honghui.zhang
2017-08-14 13:04 ` [PATCH v2 1/3] PCI: mediatek: Fix return value in case of error honghui.zhang
2017-08-14 13:04 ` honghui.zhang [this message]
2017-08-14 13:04 ` [PATCH v2 3/3] PCI: mediatek: add msi support for MT2712 and MT7622 honghui.zhang
2017-08-22 21:36 ` [PATCH v2 0/3] PCI: mediatek: Add MSI " Bjorn Helgaas
2017-08-23 1:04 ` Ryder Lee
2017-08-23 18:58 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502715868-17651-3-git-send-email-honghui.zhang@mediatek.com \
--to=honghui.zhang@mediatek.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=hongkun.cao@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=xinping.qian@mediatek.com \
--cc=yingjoe.chen@mediatek.com \
--cc=yong.wu@mediatek.com \
--cc=youlin.pei@mediatek.com \
--cc=yt.shen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).