Author: jhibbits
Date: Tue Aug 21 23:55:29 2012
New Revision: 239548
URL: http://svn.freebsd.org/changeset/base/239548

Log:
  phandle_t is unsigned, and OF_finddevice() returns (phandle_t)(-1) on
  failure, so check for that instead of 0.
  
  While here, provide a better description for ATI backlight driver.
  
  Reported by:  jchandra@
  MFC after:    3 days

Modified:
  head/sys/powerpc/powermac/atibl.c
  head/sys/powerpc/powermac/nvbl.c

Modified: head/sys/powerpc/powermac/atibl.c
==============================================================================
--- head/sys/powerpc/powermac/atibl.c   Tue Aug 21 23:44:47 2012        
(r239547)
+++ head/sys/powerpc/powermac/atibl.c   Tue Aug 21 23:55:29 2012        
(r239548)
@@ -98,7 +98,7 @@ atibl_probe(device_t dev)
 
        handle = OF_finddevice("mac-io/backlight");
 
-       if (handle <= 0)
+       if (handle == -1)
                return (ENXIO);
 
        if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) 
< 0)
@@ -107,7 +107,7 @@ atibl_probe(device_t dev)
        if (strcmp(control, "ati") != 0)
                return (ENXIO);
 
-       device_set_desc(dev, "PowerBook backlight");
+       device_set_desc(dev, "PowerBook backlight for ATI graphics");
 
        return (0);
 }

Modified: head/sys/powerpc/powermac/nvbl.c
==============================================================================
--- head/sys/powerpc/powermac/nvbl.c    Tue Aug 21 23:44:47 2012        
(r239547)
+++ head/sys/powerpc/powermac/nvbl.c    Tue Aug 21 23:55:29 2012        
(r239548)
@@ -94,7 +94,7 @@ nvbl_probe(device_t dev)
 
        handle = OF_finddevice("mac-io/backlight");
 
-       if (handle <= 0)
+       if (handle == -1)
                return (ENXIO);
 
        if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) 
< 0)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to