Changeset 132ab5d1 in mainline for uspace/drv/intctl/obio/obio.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/intctl/obio/obio.c

    r8bfb163 r132ab5d1  
    4242 */
    4343
    44 #include <align.h>
    45 #include <as.h>
    4644#include <async.h>
    4745#include <ddf/driver.h>
     
    4947#include <ddi.h>
    5048#include <errno.h>
     49#include <str_error.h>
    5150#include <inttypes.h>
    5251#include <ipc/irc.h>
     
    118117{
    119118        ddf_fun_t *fun_a = NULL;
    120         int flags;
    121         int retval;
    122119        int rc;
    123120
    124         flags = AS_AREA_READ | AS_AREA_WRITE;
    125         obio->regs = (ioport64_t *)AS_AREA_ANY;
    126         retval = physmem_map(res->base,
    127             ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags,
    128             (void *) &obio->regs);
    129 
    130         if (retval < 0) {
     121        rc = pio_enable((void *)res->base, OBIO_SIZE, (void **) &obio->regs);
     122        if (rc != EOK) {
    131123                ddf_msg(LVL_ERROR, "Error mapping OBIO registers");
    132124                rc = EIO;
     
    134126        }
    135127
    136         ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIun, res->base);
     128        ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIxn, res->base);
    137129
    138130        fun_a = ddf_fun_create(obio->dev, fun_exposed, "a");
     
    147139        rc = ddf_fun_bind(fun_a);
    148140        if (rc != EOK) {
    149                 ddf_msg(LVL_ERROR, "Failed binding function 'a'. (%d)", rc);
     141                ddf_msg(LVL_ERROR, "Failed binding function 'a': %s", str_error(rc));
    150142                goto error;
    151143        }
Note: See TracChangeset for help on using the changeset viewer.