Use device alias "mpic" to locate the macio OpenPIC. This works

on the new 12/15/17" PowerBooks that don't have the "interrupt-controller"
property underneath "/chosen", which was the previous way of
searching.
This commit is contained in:
Peter Grehan 2004-02-03 08:00:37 +00:00
parent cea179a3fe
commit 2894a94905
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125378

View File

@ -114,16 +114,15 @@ static void
openpic_ofw_identify(driver_t *driver, device_t parent)
{
device_t child;
phandle_t chosen, pic;
phandle_t pic;
char type[40];
chosen = OF_finddevice("/chosen");
if (chosen == -1)
pic = OF_finddevice("mpic");
if (pic == -1) {
printf("could not find mpic!\n");
return;
}
if (OF_getprop(chosen, "interrupt-controller", &pic, 4) != 4)
return;
OF_getprop(pic, "device_type", type, sizeof(type));
if (strcmp(type, "open-pic") != 0)