From: David Schleef Date: Fri, 26 Apr 2002 18:30:41 +0000 (+0000) Subject: Change from int to comedi_t * X-Git-Tag: r0_7_65~79 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1993ea27da790f9761df6df0f75d593e1b4c39cf;p=comedi.git Change from int to comedi_t * --- diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index 15d49f39..7f834ed9 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -129,8 +129,8 @@ COMEDI_INITCLEANUP(driver_timer); typedef struct{ - int device; // device we are emulating commands for - int subd; // subdevice we are emulating commands for + comedi_t *device; // device we are emulating commands for + int subd; // subdevice we are emulating commands for RT_TASK *rt_task; // rt task that starts scans RT_TASK *scan_task; // rt task that controls conversion timing in a scan /* io_function can point to either an input or output function @@ -583,6 +583,7 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it) /* These should probably be devconfig options[] */ const int timer_priority = 4; const int scan_priority = timer_priority + 1; + char path[20]; printk("comedi%d: timer: ",dev->minor); @@ -594,13 +595,14 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it) if((ret=alloc_private(dev,sizeof(timer_private)))<0) return ret; - devpriv->device=it->options[0]; + sprintf(path,"/dev/comedi%d",it->options[0]); + devpriv->device = comedi_open(path); devpriv->subd=it->options[1]; - printk("device %d, subdevice %d\n", devpriv->device, devpriv->subd); + printk("device %p, subdevice %d\n", devpriv->device, devpriv->subd); - emul_dev=comedi_get_device_by_minor(devpriv->device); - emul_s=emul_dev->subdevices+devpriv->subd; + emul_dev = (comedi_device *)devpriv->device; + emul_s = emul_dev->subdevices+devpriv->subd; // input or output subdevice s=dev->subdevices+0;