Changes in uspace/drv/audio/sb16/main.c [cccd60c3:f9b2cb4c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/main.c
rcccd60c3 rf9b2cb4c 37 37 #include <ddf/log.h> 38 38 #include <device/hw_res_parsed.h> 39 #include <devman.h> 39 40 #include <assert.h> 40 41 #include <stdio.h> … … 50 51 static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs, 51 52 addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16); 52 static int sb_enable_interrupt (ddf_dev_t *device, int irq);53 static int sb_enable_interrupts(ddf_dev_t *device); 53 54 54 55 static driver_ops_t sb_driver_ops = { … … 93 94 irq_cmd_t irq_cmds[irq_cmd_count]; 94 95 irq_pio_range_t irq_ranges[1]; 95 int irq_cap;96 96 97 97 sb16_t *soft_state = ddf_dev_data_alloc(device, sizeof(sb16_t)); … … 123 123 }; 124 124 125 irq_cap = register_interrupt_handler(device, irq, irq_handler, 126 &irq_code); 127 if (irq_cap < 0) { 128 rc = irq_cap; 125 rc = register_interrupt_handler(device, irq, irq_handler, &irq_code); 126 if (rc != EOK) { 129 127 ddf_log_error("Failed to register irq handler: %s.", 130 128 str_error(rc)); … … 134 132 handler_regd = true; 135 133 136 rc = sb_enable_interrupt (device, irq);134 rc = sb_enable_interrupts(device); 137 135 if (rc != EOK) { 138 136 ddf_log_error("Failed to enable interrupts: %s.", … … 170 168 error: 171 169 if (handler_regd) 172 unregister_interrupt_handler(device, irq _cap);170 unregister_interrupt_handler(device, irq); 173 171 return rc; 174 172 } … … 179 177 assert(device); 180 178 181 async_sess_t *parent_sess = ddf_dev_parent_sess_get(device); 182 if (parent_sess == NULL) 179 async_sess_t *parent_sess = devman_parent_device_connect( 180 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 181 if (!parent_sess) 183 182 return ENOMEM; 184 183 … … 186 185 hw_res_list_parsed_init(&hw_res); 187 186 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 187 async_hangup(parent_sess); 188 188 if (ret != EOK) { 189 189 return ret; … … 242 242 } 243 243 244 static int sb_enable_interrupt(ddf_dev_t *device, int irq) 245 { 246 async_sess_t *parent_sess = ddf_dev_parent_sess_get(device); 247 if (parent_sess == NULL) 244 int sb_enable_interrupts(ddf_dev_t *device) 245 { 246 async_sess_t *parent_sess = devman_parent_device_connect( 247 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 248 if (!parent_sess) 248 249 return ENOMEM; 249 250 250 return hw_res_enable_interrupt(parent_sess, irq); 251 bool enabled = hw_res_enable_interrupt(parent_sess); 252 async_hangup(parent_sess); 253 254 return enabled ? EOK : EIO; 251 255 } 252 256
Note:
See TracChangeset
for help on using the changeset viewer.