am335x_rtc.c (277042) | am335x_rtc.c (279311) |
---|---|
1/*- 2 * Copyright (c) 2015 Luiz Otavio O Souza <loos@FreeBSD.org> 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) 2015 Luiz Otavio O Souza <loos@FreeBSD.org> 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/arm/ti/am335x/am335x_rtc.c 277042 2015-01-12 03:23:16Z loos $"); | 28__FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_rtc.c 279311 2015-02-26 07:45:40Z dim $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/clock.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/module.h> --- 95 unchanged lines hidden (view full) --- 132} 133 134static int 135am335x_rtc_detach(device_t dev) 136{ 137 struct am335x_rtc_softc *sc; 138 139 sc = device_get_softc(dev); | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/clock.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/module.h> --- 95 unchanged lines hidden (view full) --- 132} 133 134static int 135am335x_rtc_detach(device_t dev) 136{ 137 struct am335x_rtc_softc *sc; 138 139 sc = device_get_softc(dev); |
140 if (sc->sc_irq_res) | 140 if (sc->sc_irq_res[0] != NULL) |
141 bus_release_resources(dev, am335x_rtc_irq_spec, sc->sc_irq_res); 142 if (sc->sc_mem_res) 143 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); 144 RTC_LOCK_DESTROY(sc); 145 146 return (0); 147} 148 --- 63 unchanged lines hidden --- | 141 bus_release_resources(dev, am335x_rtc_irq_spec, sc->sc_irq_res); 142 if (sc->sc_mem_res) 143 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); 144 RTC_LOCK_DESTROY(sc); 145 146 return (0); 147} 148 --- 63 unchanged lines hidden --- |