Ignore:
Timestamp:
2012-08-24T14:07:52Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
041ab64
Parents:
bd29f9c9 (diff), db81577 (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 with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.c

    rbd29f9c9 rbeb9336  
    3434 * USB HID keyboard device structure and API.
    3535 */
     36
     37/* XXX Fix this */
     38#define _DDF_DATA_IMPLANT
    3639
    3740#include <errno.h>
     
    162165    ipc_callid_t icallid, ipc_call_t *icall)
    163166{
    164         if (fun == NULL || fun->driver_data == NULL) {
    165                 usb_log_error("%s: Missing parameter.\n", __FUNCTION__);
    166                 async_answer_0(icallid, EINVAL);
    167                 return;
    168         }
    169 
    170167        const sysarg_t method = IPC_GET_IMETHOD(*icall);
    171         usb_kbd_t *kbd_dev = fun->driver_data;
     168        usb_kbd_t *kbd_dev = ddf_fun_data_get(fun);
    172169
    173170        switch (method) {
     
    501498        /* Store the initialized HID device and HID ops
    502499         * to the DDF function. */
    503         fun->ops = &kbdops;
    504         fun->driver_data = kbd_dev;
     500        ddf_fun_set_ops(fun, &kbdops);
     501        ddf_fun_data_implant(fun, kbd_dev);
    505502
    506503        int rc = ddf_fun_bind(fun);
     
    508505                usb_log_error("Could not bind DDF function: %s.\n",
    509506                    str_error(rc));
    510                 fun->driver_data = NULL; /* We did not allocate this. */
    511507                ddf_fun_destroy(fun);
    512508                return rc;
     
    514510
    515511        usb_log_debug("%s function created. Handle: %" PRIun "\n",
    516             HID_KBD_FUN_NAME, fun->handle);
     512            HID_KBD_FUN_NAME, ddf_fun_get_handle(fun));
    517513
    518514        usb_log_debug("Adding DDF function to category %s...\n",
     
    524520                    HID_KBD_CLASS_NAME, str_error(rc));
    525521                if (ddf_fun_unbind(fun) == EOK) {
    526                         fun->driver_data = NULL; /* We did not allocate this. */
    527522                        ddf_fun_destroy(fun);
    528523                } else {
    529524                        usb_log_error(
    530525                            "Failed to unbind `%s', will not destroy.\n",
    531                             fun->name);
     526                            ddf_fun_get_name(fun));
    532527                }
    533528                return rc;
     
    757752                if (ddf_fun_unbind(kbd_dev->fun) != EOK) {
    758753                        usb_log_warning("Failed to unbind %s.\n",
    759                             kbd_dev->fun->name);
     754                            ddf_fun_get_name(kbd_dev->fun));
    760755                } else {
    761                         usb_log_debug2("%s unbound.\n", kbd_dev->fun->name);
    762                         kbd_dev->fun->driver_data = NULL;
     756                        usb_log_debug2("%s unbound.\n",
     757                            ddf_fun_get_name(kbd_dev->fun));
    763758                        ddf_fun_destroy(kbd_dev->fun);
    764759                }
    765760        }
    766         free(kbd_dev);
    767761}
    768762
Note: See TracChangeset for help on using the changeset viewer.