Changeset 9673fd3 in mainline for uspace/drv/time/cmos-rtc/cmos-rtc.c
- Timestamp:
- 2012-08-23T11:50:07Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae827d0
- Parents:
- 2e6293b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
r2e6293b r9673fd3 71 71 /** true if device is removed */ 72 72 bool removed; 73 /** number of connected clients */ 74 int clients_connected; 73 75 /** time at which the system booted */ 74 76 time_t boottime; … … 189 191 190 192 rtc->boottime = 0; 193 rtc->clients_connected = 0; 191 194 192 195 hw_resource_list_t hw_resources; … … 565 568 566 569 fibril_mutex_lock(&rtc->mutex); 570 if (rtc->clients_connected > 0) { 571 fibril_mutex_unlock(&rtc->mutex); 572 return EBUSY; 573 } 567 574 568 575 rtc->removed = true; … … 619 626 if (rtc->removed) 620 627 rc = ENXIO; 621 else 628 else { 622 629 rc = EOK; 630 rtc->clients_connected++; 631 } 623 632 624 633 fibril_mutex_unlock(&rtc->mutex); … … 633 642 rtc_close(ddf_fun_t *fun) 634 643 { 644 rtc_t *rtc = fun_rtc(fun); 645 646 fibril_mutex_lock(&rtc->mutex); 647 648 rtc->clients_connected--; 649 assert(rtc->clients_connected >= 0); 650 651 fibril_mutex_unlock(&rtc->mutex); 635 652 } 636 653
Note:
See TracChangeset
for help on using the changeset viewer.