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