misc: cxl: Use device_type helpers to access the node type
Remove directly accessing device_node.type pointer and use the accessors instead. This will eventually allow removing the type pointer. Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
97a64ba77d
commit
55949c7e75
|
@ -1718,7 +1718,6 @@ int cxl_slot_is_switched(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
const __be32 *prop;
|
|
||||||
|
|
||||||
if (!(np = pci_device_to_OF_node(dev))) {
|
if (!(np = pci_device_to_OF_node(dev))) {
|
||||||
pr_err("cxl: np = NULL\n");
|
pr_err("cxl: np = NULL\n");
|
||||||
|
@ -1727,8 +1726,7 @@ int cxl_slot_is_switched(struct pci_dev *dev)
|
||||||
of_node_get(np);
|
of_node_get(np);
|
||||||
while (np) {
|
while (np) {
|
||||||
np = of_get_next_parent(np);
|
np = of_get_next_parent(np);
|
||||||
prop = of_get_property(np, "device_type", NULL);
|
if (!of_node_is_type(np, "pciex"))
|
||||||
if (!prop || strcmp((char *)prop, "pciex"))
|
|
||||||
break;
|
break;
|
||||||
depth++;
|
depth++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue