Skip to content
Snippets Groups Projects
Commit 6666b2fb authored by Myron Stowe's avatar Myron Stowe
Browse files

PCI: kirin: Add dev struct for of_device_get_match_data()

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066898
Upstream Status: 7dd38762

commit 7dd38762
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Wed Feb 2 09:52:41 2022 -0600

    PCI: kirin: Add dev struct for of_device_get_match_data()

    Bean reported that a622435f ("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: a622435f ("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: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>

Signed-off-by: default avatarMyron Stowe <mstowe@redhat.com>
parent 6650c67c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment