Changes in uspace/srv/hid/input/proto/mousedev.c [cce8a83:3123d2a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/proto/mousedev.c
rcce8a83 r3123d2a 54 54 /** Link to generic mouse device */ 55 55 mouse_dev_t *mouse_dev; 56 57 /** Session to mouse device */58 async_sess_t *sess;59 56 } mousedev_t; 60 57 … … 72 69 static void mousedev_destroy(mousedev_t *mousedev) 73 70 { 74 if (mousedev->sess != NULL)75 async_hangup(mousedev->sess);76 77 71 free(mousedev); 78 72 } … … 89 83 90 84 if (!IPC_GET_IMETHOD(call)) { 91 /* XXX Handle hangup */85 mousedev_destroy(mousedev); 92 86 return; 93 87 } … … 97 91 switch (IPC_GET_IMETHOD(call)) { 98 92 case MOUSEEV_MOVE_EVENT: 99 mouse_push_event_move(mousedev->mouse_dev, IPC_GET_ARG1(call), 100 IPC_GET_ARG2(call)); 93 mouse_push_event_move(mousedev->mouse_dev, 94 IPC_GET_ARG1(call), IPC_GET_ARG2(call), 95 IPC_GET_ARG3(call)); 101 96 retval = EOK; 102 97 break; 103 98 case MOUSEEV_BUTTON_EVENT: 104 mouse_push_event_button(mousedev->mouse_dev, IPC_GET_ARG1(call),105 IPC_GET_ARG 2(call));99 mouse_push_event_button(mousedev->mouse_dev, 100 IPC_GET_ARG1(call), IPC_GET_ARG2(call)); 106 101 retval = EOK; 107 102 break; … … 122 117 printf("%s: Failed starting session with '%s'\n", NAME, 123 118 mdev->svc_name); 124 return -1;119 return ENOENT; 125 120 } 126 121 … … 129 124 printf("%s: Failed allocating device structure for '%s'.\n", 130 125 NAME, mdev->svc_name); 131 return -1; 126 async_hangup(sess); 127 return ENOMEM; 132 128 } 133 134 mousedev->sess = sess;135 129 136 130 async_exch_t *exch = async_exchange_begin(sess); … … 139 133 mdev->svc_name); 140 134 mousedev_destroy(mousedev); 141 return -1; 135 async_hangup(sess); 136 return ENOENT; 142 137 } 143 138 144 139 int rc = async_connect_to_me(exch, 0, 0, 0, mousedev_callback_conn, mousedev); 145 140 async_exchange_end(exch); 141 async_hangup(sess); 146 142 147 143 if (rc != EOK) { … … 149 145 NAME, mdev->svc_name); 150 146 mousedev_destroy(mousedev); 151 return -1;147 return rc; 152 148 } 153 149 154 return 0;150 return EOK; 155 151 } 156 152
Note:
See TracChangeset
for help on using the changeset viewer.