diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-02-19 22:15:12 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-02-19 22:15:12 +0000 |
commit | 572ad364bdcb1c798ca887f9cb2757f3ca553490 (patch) | |
tree | 3aa297e03ac64b19cfb448bbc14b61953b26f0af /sys/arch/macppc/dev | |
parent | f0f9595e74c58aea49e16a63bfaf21232b0540f8 (diff) |
Only attach if the "device_type" propery is "programmer-button". On the iMac
G5 (PowerMac8,2) attaching pgs(4) makes the machine hang. This machine has
the "device_type" property set to "gpio" attaching pgs(4), which is that
case for newer machines that don't seem to have a real button anyway.
ok miod@, jasper@
Diffstat (limited to 'sys/arch/macppc/dev')
-rw-r--r-- | sys/arch/macppc/dev/pgs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/arch/macppc/dev/pgs.c b/sys/arch/macppc/dev/pgs.c index cedb1bf265c..dfec63a60f6 100644 --- a/sys/arch/macppc/dev/pgs.c +++ b/sys/arch/macppc/dev/pgs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgs.c,v 1.1 2010/04/09 19:24:17 jasper Exp $ */ +/* $OpenBSD: pgs.c,v 1.2 2011/02/19 22:15:11 kettenis Exp $ */ /* * Copyright (c) 2010 Jasper Lievisse Adriaanse <jasper@openbsd.org> * @@ -54,11 +54,16 @@ int pgs_match(struct device *parent, void *arg, void *aux) { struct confargs *ca = aux; + char type[32]; - if (strcmp(ca->ca_name, "programmer-switch") == 0) - return 1; + if (strcmp(ca->ca_name, "programmer-switch") != 0) + return 0; - return 0; + OF_getprop(ca->ca_node, "device_type", type, sizeof(type)); + if (strcmp(type, "programmer-switch") != 0) + return 0; + + return 1; } void |