Skip to content

Commit a622435

Browse files
firebolt007bjorn-helgaas
authored andcommitted
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/[email protected] Signed-off-by: Fan Fei <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Xiaowei Song <[email protected]> Cc: Binghui Wang <[email protected]>
1 parent 39a29fb commit a622435

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/dwc/pcie-kirin.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,6 @@ static const struct of_device_id kirin_pcie_match[] = {
773773
static int kirin_pcie_probe(struct platform_device *pdev)
774774
{
775775
enum pcie_kirin_phy_type phy_type;
776-
const struct of_device_id *of_id;
777776
struct device *dev = &pdev->dev;
778777
struct kirin_pcie *kirin_pcie;
779778
struct dw_pcie *pci;
@@ -784,13 +783,12 @@ static int kirin_pcie_probe(struct platform_device *pdev)
784783
return -EINVAL;
785784
}
786785

787-
of_id = of_match_device(kirin_pcie_match, dev);
788-
if (!of_id) {
786+
phy_type = (long)of_device_get_match_data(dev);
787+
if (!phy_type) {
789788
dev_err(dev, "OF data missing\n");
790789
return -EINVAL;
791790
}
792791

793-
phy_type = (long)of_id->data;
794792

795793
kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
796794
if (!kirin_pcie)

0 commit comments

Comments
 (0)