Date: Tue, 29 Oct 2013 20:38:59 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257365 - in head/sys/mips: mips nlm rmi Message-ID: <201310292038.r9TKcxoC025287@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Tue Oct 29 20:38:58 2013 New Revision: 257365 URL: http://svnweb.freebsd.org/changeset/base/257365 Log: Panics about how things can't be attached should probably happen in the attach method rather than probe. Submitted by: brooks Modified: head/sys/mips/mips/tick.c head/sys/mips/nlm/tick.c head/sys/mips/rmi/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/mips/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -309,9 +309,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -329,6 +326,9 @@ clock_attach(device_t dev) struct clock_softc *sc; int error; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); sc->intr_rid = 0; sc->intr_res = bus_alloc_resource(dev, Modified: head/sys/mips/nlm/tick.c ============================================================================== --- head/sys/mips/nlm/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/nlm/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -314,9 +314,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -333,6 +330,9 @@ clock_attach(device_t dev) { struct clock_softc *sc; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); cpu_establish_hardintr("compare", clock_intr, NULL, sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler); Modified: head/sys/mips/rmi/tick.c ============================================================================== --- head/sys/mips/rmi/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/rmi/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -311,9 +311,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -330,6 +327,9 @@ clock_attach(device_t dev) { struct clock_softc *sc; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); cpu_establish_hardintr("compare", clock_intr, NULL, sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310292038.r9TKcxoC025287>