PCI: kirin: Prefer of_device_get_match_data()
The kirin driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-8-helgaas@kernel.org Signed-off-by: Fan Fei <ffclaire1224@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Xiaowei Song <songxiaowei@hisilicon.com> Cc: Binghui Wang <wangbinghui@hisilicon.com>
This commit is contained in:
parent
39a29fbd4e
commit
a622435fbe
@ -773,7 +773,6 @@ static const struct of_device_id kirin_pcie_match[] = {
|
|||||||
static int kirin_pcie_probe(struct platform_device *pdev)
|
static int kirin_pcie_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
enum pcie_kirin_phy_type phy_type;
|
enum pcie_kirin_phy_type phy_type;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct kirin_pcie *kirin_pcie;
|
struct kirin_pcie *kirin_pcie;
|
||||||
struct dw_pcie *pci;
|
struct dw_pcie *pci;
|
||||||
@ -784,13 +783,12 @@ static int kirin_pcie_probe(struct platform_device *pdev)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
of_id = of_match_device(kirin_pcie_match, dev);
|
phy_type = (long)of_device_get_match_data(dev);
|
||||||
if (!of_id) {
|
if (!phy_type) {
|
||||||
dev_err(dev, "OF data missing\n");
|
dev_err(dev, "OF data missing\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
phy_type = (long)of_id->data;
|
|
||||||
|
|
||||||
kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
|
kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
|
||||||
if (!kirin_pcie)
|
if (!kirin_pcie)
|
||||||
|
Loading…
Reference in New Issue
Block a user