From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:38:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE44178; Tue, 29 Oct 2013 20:38:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE1C24E8; Tue, 29 Oct 2013 20:38:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKcxJ8025290; Tue, 29 Oct 2013 20:38:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKcxoC025287; Tue, 29 Oct 2013 20:38:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310292038.r9TKcxoC025287@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 20:38:59 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2013 20:38:59 -0000 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);