diff options
| author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2019-11-03 20:40:55 +0000 |
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2019-11-03 20:40:55 +0000 |
| commit | bf9c3c58cac8447eb57f9b39fe4d55c06e42ed8a (patch) | |
| tree | b0632b796898e70215125f9d66a4a1a434b2b3ad /sys/dev/ichiic | |
| parent | 984ed3e493adc93daf6c79800a1ae2fa53d450e9 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ichiic')
| -rw-r--r-- | sys/dev/ichiic/ig4_iic.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index b6b2e06ceff56..1d26dff59a7d7 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -629,10 +629,18 @@ ig4iic_attach(ig4iic_softc_t *sc) #endif mtx_lock(&sc->io_lock); - if (set_controller(sc, 0)) + if (set_controller(sc, 0)) { device_printf(sc->dev, "controller error during attach-1\n"); - if (set_controller(sc, IG4_I2C_ENABLE)) + mtx_unlock(&sc->io_lock); + error = ENXIO; + goto done; + } + if (set_controller(sc, IG4_I2C_ENABLE)) { device_printf(sc->dev, "controller error during attach-2\n"); + mtx_unlock(&sc->io_lock); + error = ENXIO; + goto done; + } mtx_unlock(&sc->io_lock); error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ig4iic_intr, sc, &sc->intr_handle); |
