Module Name: src Committed By: plunky Date: Thu Apr 5 20:13:35 UTC 2012
Modified Files: src/sys/dev: midi.c src/sys/dev/isa: midi_pcppi.c Log Message: move the pmf_device_register() for midi.c and midi_pcppi.c to midi_attach() for symmetry, since it is removed in midi detach code and don't need to call device_pmf_is_registered() before registering it To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/sys/dev/midi.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/isa/midi_pcppi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/midi.c diff -u src/sys/dev/midi.c:1.75 src/sys/dev/midi.c:1.76 --- src/sys/dev/midi.c:1.75 Tue Jan 10 17:53:51 2012 +++ src/sys/dev/midi.c Thu Apr 5 20:13:34 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $ */ +/* $NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $ */ /* * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $"); #include "midi.h" #include "sequencer.h" @@ -166,10 +166,6 @@ midiattach(device_t parent, device_t sel sc->hw_if = hwp; sc->hw_hdl = hdlp; midi_attach(sc, parent); - if (!device_pmf_is_registered(self)) - if (!pmf_device_register(self, NULL, NULL)) - aprint_error_dev(self, - "couldn't establish power handler\n"); } static int @@ -296,6 +292,9 @@ midi_attach(struct midi_softc *sc, devic aprint_naive("\n"); aprint_normal(": %s\n", mi.name); + + if (!pmf_device_register(sc->dev, NULL, NULL)) + aprint_error_dev(sc->dev, "couldn't establish power handler\n"); } void Index: src/sys/dev/isa/midi_pcppi.c diff -u src/sys/dev/isa/midi_pcppi.c:1.24 src/sys/dev/isa/midi_pcppi.c:1.25 --- src/sys/dev/isa/midi_pcppi.c:1.24 Wed Nov 23 23:07:32 2011 +++ src/sys/dev/isa/midi_pcppi.c Thu Apr 5 20:13:35 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: midi_pcppi.c,v 1.24 2011/11/23 23:07:32 jmcneill Exp $ */ +/* $NetBSD: midi_pcppi.c,v 1.25 2012/04/05 20:13:35 plunky Exp $ */ /* * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: midi_pcppi.c,v 1.24 2011/11/23 23:07:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midi_pcppi.c,v 1.25 2012/04/05 20:13:35 plunky Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -106,10 +106,6 @@ midi_pcppi_attach(device_t parent, devic midisyn_attach(&sc->sc_mididev, ms); midi_attach(&sc->sc_mididev, parent); - if (!device_pmf_is_registered(self)) - if (!pmf_device_register(self, NULL, NULL)) - aprint_error_dev(self, - "couldn't establish power handler\n"); } static int