From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:57:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FB84DB9; Thu, 25 Jul 2013 16:57:28 +0000 (UTC) (envelope-from marcel@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 2C77A2417; Thu, 25 Jul 2013 16:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PGvSe9003654; Thu, 25 Jul 2013 16:57:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PGvSWq003653; Thu, 25 Jul 2013 16:57:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307251657.r6PGvSWq003653@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 25 Jul 2013 16:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253654 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:57:28 -0000 Author: marcel Date: Thu Jul 25 16:57:27 2013 New Revision: 253654 URL: http://svnweb.freebsd.org/changeset/base/253654 Log: Set the device description after we call uart_probe(). In uart_probe() we call device-specific probe functions, which can (and typically will) set the device description based on low-level device probe information. In the end we never actually used the device description that we so carefully maintained in the PCI match table. By setting the device description after we call uart_probe(), we'll print the more user- friendly description by default. Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Thu Jul 25 16:34:34 2013 (r253653) +++ head/sys/dev/uart/uart_bus_pci.c Thu Jul 25 16:57:27 2013 (r253654) @@ -162,6 +162,7 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; + int result; sc = device_get_softc(dev); @@ -174,9 +175,14 @@ uart_pci_probe(device_t dev) return (ENXIO); match: + result = uart_bus_probe(dev, 0, id->rclk, id->rid, 0); + /* Bail out on error. */ + if (result > 0) + return (result); + /* Set/override the device description. */ if (id->desc) device_set_desc(dev, id->desc); - return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0)); + return (result); } DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL);