Changeset 43e660c in mainline
- Timestamp:
- 2012-08-13T13:57:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a58347
- Parents:
- ea5cc5b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
rea5cc5b r43e660c 72 72 /** The I/O port used to access the CMOS registers */ 73 73 ioport8_t *port; 74 /** true if a client is connected to the device */75 bool client_connected;76 74 /** true if device is removed */ 77 75 bool removed; … … 533 531 ddf_fun_add_to_category(fun, "clock"); 534 532 535 rtc->client_connected = false;536 537 533 ddf_msg(LVL_NOTE, "Device %s successfully initialized", 538 534 dev->name); … … 561 557 562 558 fibril_mutex_lock(&rtc->mutex); 563 if (rtc->client_connected) {564 fibril_mutex_unlock(&rtc->mutex);565 return EBUSY;566 }567 559 568 560 rtc->removed = true; … … 617 609 fibril_mutex_lock(&rtc->mutex); 618 610 619 if (rtc->client_connected) 620 rc = ELIMIT; 621 else if (rtc->removed) 611 if (rtc->removed) 622 612 rc = ENXIO; 623 else {613 else 624 614 rc = EOK; 625 rtc->client_connected = true;626 }627 615 628 616 fibril_mutex_unlock(&rtc->mutex); … … 637 625 rtc_close(ddf_fun_t *fun) 638 626 { 639 rtc_t *rtc = RTC_FROM_FNODE(fun);640 641 fibril_mutex_lock(&rtc->mutex);642 643 assert(rtc->client_connected);644 rtc->client_connected = false;645 646 fibril_mutex_unlock(&rtc->mutex);647 627 } 648 628
Note:
See TracChangeset
for help on using the changeset viewer.