Only add the backlight device if it actually exists in OF.

MFC after:	1 week
This commit is contained in:
Justin Hibbits 2013-08-31 16:31:48 +00:00
parent f0bd82a11b
commit 427467b32e
2 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,8 @@ DRIVER_MODULE(atibl, vgapci, atibl_driver, atibl_devclass, 0, 0);
static void
atibl_identify(driver_t *driver, device_t parent)
{
if (OF_finddevice("mac-io/backlight") == -1)
return;
if (device_find_child(parent, "backlight", -1) == NULL)
device_add_child(parent, "backlight", -1);
}

View File

@ -82,6 +82,8 @@ DRIVER_MODULE(nvbl, vgapci, nvbl_driver, nvbl_devclass, 0, 0);
static void
nvbl_identify(driver_t *driver, device_t parent)
{
if (OF_finddevice("mac-io/backlight") == -1)
return;
if (device_find_child(parent, "backlight", -1) == NULL)
device_add_child(parent, "backlight", -1);
}