From db710e1091a0273897c76d19c2e204f984fcacdf Mon Sep 17 00:00:00 2001
From: jhibbits <jhibbits@FreeBSD.org>
Date: Sat, 31 Aug 2013 16:31:48 +0000
Subject: Only add the backlight device if it actually exists in OF.

MFC after:	1 week
---
 sys/powerpc/powermac/atibl.c | 2 ++
 sys/powerpc/powermac/nvbl.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sys/powerpc/powermac/atibl.c b/sys/powerpc/powermac/atibl.c
index fff76d0..f4ac9b0 100644
--- a/sys/powerpc/powermac/atibl.c
+++ b/sys/powerpc/powermac/atibl.c
@@ -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);
 }
diff --git a/sys/powerpc/powermac/nvbl.c b/sys/powerpc/powermac/nvbl.c
index 1f89881..033f972 100644
--- a/sys/powerpc/powermac/nvbl.c
+++ b/sys/powerpc/powermac/nvbl.c
@@ -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);
 }
-- 
cgit v1.1