subr_bus.c (144071) | subr_bus.c (144443) |
---|---|
1/*- 2 * Copyright (c) 1997,1998,2003 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997,1998,2003 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/subr_bus.c 144071 2005-03-24 18:13:11Z phk $"); | 28__FBSDID("$FreeBSD: head/sys/kern/subr_bus.c 144443 2005-03-31 22:49:31Z jhb $"); |
29 30#include "opt_bus.h" 31 32#include <sys/param.h> 33#include <sys/conf.h> 34#include <sys/filio.h> 35#include <sys/lock.h> 36#include <sys/kernel.h> --- 808 unchanged lines hidden (view full) --- 845 846 /* 847 * Make sure the devclass which the driver is implementing exists. 848 */ 849 devclass_find_internal(driver->name, 0, TRUE); 850 851 dl->driver = driver; 852 TAILQ_INSERT_TAIL(&dc->drivers, dl, link); | 29 30#include "opt_bus.h" 31 32#include <sys/param.h> 33#include <sys/conf.h> 34#include <sys/filio.h> 35#include <sys/lock.h> 36#include <sys/kernel.h> --- 808 unchanged lines hidden (view full) --- 845 846 /* 847 * Make sure the devclass which the driver is implementing exists. 848 */ 849 devclass_find_internal(driver->name, 0, TRUE); 850 851 dl->driver = driver; 852 TAILQ_INSERT_TAIL(&dc->drivers, dl, link); |
853 driver->refs++; | 853 driver->refs++; /* XXX: kobj_mtx */ |
854 855 /* 856 * Call BUS_DRIVER_ADDED for any existing busses in this class. 857 */ 858 for (i = 0; i < dc->maxunit; i++) 859 if (dc->devices[i]) 860 BUS_DRIVER_ADDED(dc->devices[i], driver); 861 --- 63 unchanged lines hidden (view full) --- 925 device_set_driver(dev, NULL); 926 } 927 } 928 } 929 930 TAILQ_REMOVE(&busclass->drivers, dl, link); 931 free(dl, M_BUS); 932 | 854 855 /* 856 * Call BUS_DRIVER_ADDED for any existing busses in this class. 857 */ 858 for (i = 0; i < dc->maxunit; i++) 859 if (dc->devices[i]) 860 BUS_DRIVER_ADDED(dc->devices[i], driver); 861 --- 63 unchanged lines hidden (view full) --- 925 device_set_driver(dev, NULL); 926 } 927 } 928 } 929 930 TAILQ_REMOVE(&busclass->drivers, dl, link); 931 free(dl, M_BUS); 932 |
933 /* XXX: kobj_mtx */ |
|
933 driver->refs--; 934 if (driver->refs == 0) 935 kobj_class_free((kobj_class_t) driver); 936 937 bus_data_generation_update(); 938 return (0); 939} 940 --- 3002 unchanged lines hidden --- | 934 driver->refs--; 935 if (driver->refs == 0) 936 kobj_class_free((kobj_class_t) driver); 937 938 bus_data_generation_update(); 939 return (0); 940} 941 --- 3002 unchanged lines hidden --- |