Date: Mon, 2 Feb 2015 11:12:32 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278072 - stable/10/sys/arm/broadcom/bcm2835 Message-ID: <201502021112.t12BCWXT007022@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Mon Feb 2 11:12:31 2015 New Revision: 278072 URL: https://svnweb.freebsd.org/changeset/base/278072 Log: MFC r277206: Catch a few cases where we need to release memory resources on errors. Place parentheses around variables in macros. Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 2 11:06:41 2015 (r278071) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 2 11:12:31 2015 (r278072) @@ -252,6 +252,7 @@ bcm_bsc_attach(device_t dev) } if (i == nitems(bcm_bsc_pins)) { device_printf(dev, "only bsc0 and bsc1 are supported\n"); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); return (ENXIO); } @@ -262,6 +263,7 @@ bcm_bsc_attach(device_t dev) gpio = devclass_get_device(devclass_find("gpio"), 0); if (!gpio) { device_printf(dev, "cannot find gpio0\n"); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); return (ENXIO); } bcm_gpio_set_alternate(gpio, bcm_bsc_pins[i].sda, BCM_GPIO_ALT0); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 2 11:06:41 2015 (r278071) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 2 11:12:31 2015 (r278072) @@ -58,9 +58,9 @@ struct bcm_bsc_softc { #define BCM_I2C_ERROR 0x04 #define BCM_BSC_WRITE(_sc, _off, _val) \ - bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) + bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, _off, _val) #define BCM_BSC_READ(_sc, _off) \ - bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, _off) #define BCM_BSC_LOCK(_sc) \ mtx_lock(&(_sc)->sc_mtx)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502021112.t12BCWXT007022>