Changeset ae827d0 in mainline


Ignore:
Timestamp:
2012-08-23T14:28:14Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5572ad1
Parents:
9673fd3
Message:

rtc: make the driver - port IO / memory mapped IO - neutral.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/date/date.c

    r9673fd3 rae827d0  
    111111        rc = loc_category_get_svcs(cat_id, &svc_ids, &svc_cnt);
    112112        if (rc != EOK) {
    113                 printf(NAME ": Cannot get the list of services in the clock \
    114                     category\n");
     113                printf(NAME ": Cannot get the list of services in the clock "
     114                    "category\n");
    115115                goto exit;
    116116        }
     
    118118        /* Check if there are available services in the clock category */
    119119        if (svc_cnt == 0) {
    120                 printf(NAME ": No available service found in \
    121                     the clock category\n");
     120                printf(NAME ": No available service found in "
     121                    "the clock category\n");
    122122                goto exit;
    123123        }
  • uspace/drv/time/cmos-rtc/cmos-rtc.c

    r9673fd3 rae827d0  
    217217                res = &hw_resources.resources[i];
    218218
    219                 if (res->type == IO_RANGE) {
    220                         if (res->res.io_range.size < REG_COUNT) {
    221                                 ddf_msg(LVL_ERROR, "I/O range assigned to \
    222                                     device %s is too small",
    223                                     ddf_dev_get_name(rtc->dev));
    224                                 rc = ELIMIT;
    225                                 goto error;
    226                         }
    227                         rtc->io_addr = (ioport8_t *) res->res.io_range.address;
    228                         ioport = true;
    229                         ddf_msg(LVL_NOTE, "Device %s was assigned I/O address \
    230                             0x%x", ddf_dev_get_name(rtc->dev), rtc->io_addr);
     219                if (res->res.io_range.size < REG_COUNT) {
     220                        ddf_msg(LVL_ERROR, "I/O range assigned to \
     221                            device %s is too small",
     222                            ddf_dev_get_name(rtc->dev));
     223                        rc = ELIMIT;
     224                        continue;
    231225                }
    232         }
     226
     227                rtc->io_addr = (ioport8_t *) res->res.io_range.address;
     228                ioport = true;
     229                ddf_msg(LVL_NOTE, "Device %s was assigned I/O address "
     230                    "0x%x", ddf_dev_get_name(rtc->dev), rtc->io_addr);
     231                rc = EOK;
     232                break;
     233        }
     234
     235        if (rc != EOK)
     236                goto error;
    233237
    234238        if (!ioport) {
Note: See TracChangeset for help on using the changeset viewer.