cambria_led.c (186352) | cambria_led.c (194015) |
---|---|
1/*- 2 * Copyright (c) 2008 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 9 unchanged lines hidden (view full) --- 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 9 unchanged lines hidden (view full) --- 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> |
26__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_led.c 186352 2008-12-20 03:26:09Z sam $"); | 26__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_led.c 194015 2009-06-11 17:05:13Z avg $"); |
27 28/* 29 * Gateworks Cambria Octal LED Latch driver. 30 */ 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/module.h> --- 62 unchanged lines hidden (view full) --- 97 sc->sc_leds[4] = led_create(led_E, sc, "E"); 98 sc->sc_leds[5] = led_create(led_F, sc, "F"); 99 sc->sc_leds[6] = led_create(led_G, sc, "G"); 100 sc->sc_leds[7] = led_create(led_H, sc, "H"); 101 102 return 0; 103} 104 | 27 28/* 29 * Gateworks Cambria Octal LED Latch driver. 30 */ 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/module.h> --- 62 unchanged lines hidden (view full) --- 97 sc->sc_leds[4] = led_create(led_E, sc, "E"); 98 sc->sc_leds[5] = led_create(led_F, sc, "F"); 99 sc->sc_leds[6] = led_create(led_G, sc, "G"); 100 sc->sc_leds[7] = led_create(led_H, sc, "H"); 101 102 return 0; 103} 104 |
105static void | 105static int |
106led_detach(device_t dev) 107{ 108 struct led_softc *sc = device_get_softc(dev); 109 int i; 110 111 for (i = 0; i < 8; i++) { 112 struct cdev *led = sc->sc_leds[i]; 113 if (led != NULL) 114 led_destroy(led); 115 } | 106led_detach(device_t dev) 107{ 108 struct led_softc *sc = device_get_softc(dev); 109 int i; 110 111 for (i = 0; i < 8; i++) { 112 struct cdev *led = sc->sc_leds[i]; 113 if (led != NULL) 114 led_destroy(led); 115 } |
116 return (0); |
|
116} 117 118static device_method_t led_methods[] = { 119 DEVMETHOD(device_probe, led_probe), 120 DEVMETHOD(device_attach, led_attach), | 117} 118 119static device_method_t led_methods[] = { 120 DEVMETHOD(device_probe, led_probe), 121 DEVMETHOD(device_attach, led_attach), |
121 DEVMETHOD(device_attach, led_detach), | 122 DEVMETHOD(device_detach, led_detach), |
122 123 {0, 0}, 124}; 125 126static driver_t led_driver = { 127 "led_cambria", 128 led_methods, 129 sizeof(struct led_softc), 130}; 131static devclass_t led_devclass; 132DRIVER_MODULE(led_cambria, ixp, led_driver, led_devclass, 0, 0); | 123 124 {0, 0}, 125}; 126 127static driver_t led_driver = { 128 "led_cambria", 129 led_methods, 130 sizeof(struct led_softc), 131}; 132static devclass_t led_devclass; 133DRIVER_MODULE(led_cambria, ixp, led_driver, led_devclass, 0, 0); |