Switch qoriq_gpio over to using ofw_bus_search_compatible
This will make it easier to add more compatibility strings in the future, if necessary.
This commit is contained in:
parent
dd4b1792c7
commit
52f0686952
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315879
@ -215,13 +215,18 @@ qoriq_gpio_pin_toggle(device_t dev, uint32_t pin)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static struct ofw_compat_data gpio_matches[] = {
|
||||
{"fsl,qoriq-gpio", 1},
|
||||
{"fsl,pq3-gpio", 1},
|
||||
{"fsl,mpc8572-gpio", 1},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
static int
|
||||
qoriq_gpio_probe(device_t dev)
|
||||
{
|
||||
|
||||
if (!ofw_bus_is_compatible(dev, "fsl,qoriq-gpio") &&
|
||||
!ofw_bus_is_compatible(dev, "fsl,pq3-gpio") &&
|
||||
!ofw_bus_is_compatible(dev, "fsl,mpc8572-gpio"))
|
||||
if (ofw_bus_search_compatible(dev, gpio_matches)->ocd_data == 0)
|
||||
return (ENXIO);
|
||||
|
||||
device_set_desc(dev, "Freescale QorIQ GPIO driver");
|
||||
|
Loading…
Reference in New Issue
Block a user