Commit 7dd3876
committed
PCI: kirin: Add dev struct for of_device_get_match_data()
Bean reported that a622435 ("PCI: kirin: Prefer
of_device_get_match_data()") broke kirin_pcie_probe() because it assumed
match data of 0 was a failure when in fact, it meant the match data was
"(void *)PCIE_KIRIN_INTERNAL_PHY".
Therefore, probing of "hisilicon,kirin960-pcie" devices failed with -EINVAL
and an "OF data missing" message.
Add a struct kirin_pcie_data to encode the PHY type. Then the result of
of_device_get_match_data() should always be a non-NULL pointer to a struct
kirin_pcie_data that contains the PHY type.
Fixes: a622435 ("PCI: kirin: Prefer of_device_get_match_data()")
Link: https://lore.kernel.org/r/20220202162659.GA12603@bhelgaas
Link: https://lore.kernel.org/r/20220201215941.1203155-1-huobean@gmail.com
Reported-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>1 parent 053ca37 commit 7dd3876
1 file changed
Lines changed: 18 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
759 | 771 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 772 | + | |
| 773 | + | |
768 | 774 | | |
769 | 775 | | |
770 | 776 | | |
771 | 777 | | |
772 | 778 | | |
773 | | - | |
774 | 779 | | |
| 780 | + | |
775 | 781 | | |
776 | 782 | | |
777 | 783 | | |
| |||
781 | 787 | | |
782 | 788 | | |
783 | 789 | | |
784 | | - | |
785 | | - | |
| 790 | + | |
| 791 | + | |
786 | 792 | | |
787 | 793 | | |
788 | 794 | | |
789 | 795 | | |
790 | | - | |
791 | 796 | | |
792 | 797 | | |
793 | 798 | | |
| |||
800 | 805 | | |
801 | 806 | | |
802 | 807 | | |
803 | | - | |
| 808 | + | |
804 | 809 | | |
805 | 810 | | |
806 | 811 | | |
| |||
0 commit comments