Fix botches in r201005:
- Actually use the newly introduced sc_res in the front-end. - Remove a whitespace glitch in mk48txx_gettime().
This commit is contained in:
parent
1323e3dbec
commit
209817b163
@ -184,7 +184,7 @@ mk48txx_gettime(device_t dev, struct timespec *ts)
|
||||
* Set dow = -1 because some drivers (for example the NetBSD and
|
||||
* OpenBSD mk48txx(4)) don't set it correctly.
|
||||
*/
|
||||
ct.dow = - 1;
|
||||
ct.dow = -1;
|
||||
#endif
|
||||
ct.mon = FROMBCD(FROMREG(MK48TXX_IMON, MK48TXX_MON_MASK));
|
||||
year = FROMBCD(FROMREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK));
|
||||
|
@ -119,7 +119,6 @@ static int
|
||||
eeprom_attach(device_t dev)
|
||||
{
|
||||
struct mk48txx_softc *sc;
|
||||
struct resource *res;
|
||||
struct timespec ts;
|
||||
int error, rid;
|
||||
|
||||
@ -128,8 +127,9 @@ eeprom_attach(device_t dev)
|
||||
mtx_init(&sc->sc_mtx, "eeprom_mtx", NULL, MTX_DEF);
|
||||
|
||||
rid = 0;
|
||||
res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
|
||||
if (res == NULL) {
|
||||
sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
|
||||
RF_ACTIVE);
|
||||
if (sc->sc_res == NULL) {
|
||||
device_printf(dev, "cannot allocate resources\n");
|
||||
error = ENXIO;
|
||||
goto fail_mtx;
|
||||
@ -178,7 +178,7 @@ eeprom_attach(device_t dev)
|
||||
return (0);
|
||||
|
||||
fail_res:
|
||||
bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
|
||||
bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_res);
|
||||
fail_mtx:
|
||||
mtx_destroy(&sc->sc_mtx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user