Changeset c47f1b6 in mainline
- Timestamp:
- 2012-03-31T11:37:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 557b7b3
- Parents:
- 9d5003e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
r9d5003e0 rc47f1b6 55 55 /** The fibril mutex for synchronizing the access to the device */ 56 56 fibril_mutex_t mutex; 57 /** The base I/O address of the device registers */ 58 uint32_t io_addr; 57 59 } rtc_t; 58 60 … … 76 78 static driver_ops_t rtc_ops = { 77 79 .dev_add = rtc_dev_add, 78 .dev_remove = NULL, 80 .dev_remove = NULL, /* XXX */ 79 81 }; 80 82 … … 97 99 ddf_log_init(NAME, LVL_ERROR); 98 100 99 rtc_dev_ops.open = NULL; 100 rtc_dev_ops.close = NULL; 101 rtc_dev_ops.open = NULL; /* XXX */ 102 rtc_dev_ops.close = NULL; /* XXX */ 101 103 102 104 rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops; 103 rtc_dev_ops.default_handler = NULL; 105 rtc_dev_ops.default_handler = NULL; /* XXX */ 104 106 } 105 107 … … 113 115 rtc_dev_initialize(rtc_t *rtc) 114 116 { 117 /* XXX Do cleanup in case of failure */ 115 118 int rc; 119 size_t i; 120 hw_resource_t *res; 121 bool ioport = false; 116 122 117 123 ddf_msg(LVL_DEBUG, "rtc_dev_initialize %s", rtc->dev->name); … … 138 144 } 139 145 146 for (i = 0; i < hw_resources.count; ++i) { 147 res = &hw_resources.resources[i]; 148 149 if (res->type == IO_RANGE) { 150 rtc->io_addr = res->res.io_range.address; 151 ioport = true; 152 ddf_msg(LVL_NOTE, "Device %s was assigned I/O address \ 153 0x%x", rtc->dev->name, rtc->io_addr); 154 } 155 } 156 157 if (!ioport) { 158 /* No I/O address assigned to this device */ 159 ddf_msg(LVL_ERROR, "Missing HW resource for device %s", 160 rtc->dev->name); 161 return ENOENT; 162 } 163 164 hw_res_clean_resource_list(&hw_resources); 165 140 166 return EOK; 141 167 }
Note:
See TracChangeset
for help on using the changeset viewer.