From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 23 12:05:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8195D1065670; Fri, 23 Mar 2012 12:05:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428538FC27; Fri, 23 Mar 2012 12:05:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NC5qZl075451; Fri, 23 Mar 2012 12:05:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NC5qpw075449; Fri, 23 Mar 2012 12:05:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203231205.q2NC5qpw075449@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Mar 2012 12:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233358 - in stable/9/sys: i386/conf kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 12:05:52 -0000 Author: jhb Date: Fri Mar 23 12:05:51 2012 New Revision: 233358 URL: http://svn.freebsd.org/changeset/base/233358 Log: MFC 232218: Clear the a device's description string anytime it's driver changes. Descriptions are specific to drivers and we don't change drivers on attached devices. This fixes a few places where we were not clearing the description when detaching a driver (e.g. if device_attach() failed). While here, fix a few other nits: - Remove spurious call to remove a device's driver from devclass_driver_deleted(). device_detach() removes it already. - Fix a typo. Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Fri Mar 23 12:04:44 2012 (r233357) +++ stable/9/sys/kern/subr_bus.c Fri Mar 23 12:05:51 2012 (r233358) @@ -1129,7 +1129,6 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2091,7 +2090,7 @@ device_probe_child(device_t dev, device_ /* XXX What happens if we rebid and got no best? */ if (best) { /* - * If this device was atached, and we were asked to + * If this device was attached, and we were asked to * rescan, and it is a different driver, then we have * to detach the old driver and reattach this new one. * Note, we don't have to check for DF_REBID here @@ -2598,6 +2597,7 @@ device_set_driver(device_t dev, driver_t free(dev->softc, M_BUS_SC); dev->softc = NULL; } + device_set_desc(dev, NULL); kobj_delete((kobj_t) dev, NULL); dev->driver = driver; if (driver) { @@ -2782,7 +2782,6 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); - device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0);