Module: xenomai-abe
Branch: analogy
Commit: 21ec68de98cc92ae4bd63d9caa7e04827750e5d3
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=21ec68de98cc92ae4bd63d9caa7e04827750e5d3

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Mon May 24 23:34:19 2010 +0200

analogy: update a4l_set_dev and remove useless info traces (broken)

---

 include/analogy/device.h      |    2 +-
 ksrc/drivers/analogy/device.c |   39 +++++----------------------------------
 2 files changed, 6 insertions(+), 35 deletions(-)

diff --git a/include/analogy/device.h b/include/analogy/device.h
index 51b99b5..6930a38 100644
--- a/include/analogy/device.h
+++ b/include/analogy/device.h
@@ -91,7 +91,7 @@ int a4l_rdproc_devs(char *page,
                    off_t off, int count, int *eof, void *data);
 
 /* --- Context related function / macro --- */
-void a4l_set_dev(struct rtdm_dev_context *context);
+void a4l_set_dev(a4l_cxt_t *cxt);
 #define a4l_get_dev(x) ((x)->dev)
 
 /* --- Upper layer functions --- */
diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index 4a3c879..a2d23c8 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -43,8 +43,6 @@ void a4l_init_devs(void)
        for (i = 0; i < A4L_NB_DEVICES; i++) {          
                a4l_lock_init(&a4l_devs[i].lock);
                a4l_devs[i].transfer.irq_desc.irq = A4L_IRQ_UNUSED;
-               a4l_devs[i].transfer.idx_read_subd = A4L_IDX_UNUSED;
-               a4l_devs[i].transfer.idx_write_subd = A4L_IDX_UNUSED;
        }
 }
 
@@ -59,13 +57,10 @@ int a4l_check_cleanup_devs(void)
        return ret;
 }
 
-void a4l_set_dev(struct rtdm_dev_context *context)
+void a4l_set_dev(a4l_cxt_t *cxt)
 {
-       /* Get the context's private structure */
-       a4l_cxt_t *cxt = (a4l_cxt_t *)context->dev_private;
-       /* Retrive the minor index */
-       static int minor = context->device->device_id;
-       
+       /* Retrieve the minor index */
+       static int minor = a4l_get_minor(cxt);  
        /* Fill the dev fields accordingly */
        cxt->dev = &(a4l_devs[minor]);
 }
@@ -208,9 +203,6 @@ int a4l_fill_lnkdesc(a4l_cxt_t * cxt,
        char *tmpname = NULL;
        void *tmpopts = NULL;
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_fill_lnkdesc: minor=%d\n", a4l_get_minor(cxt));
-
        ret = rtdm_safe_copy_from_user(cxt->user_info,
                                       link_arg, arg, sizeof(a4l_lnkdesc_t));
        if (ret != 0) {
@@ -285,9 +277,6 @@ int a4l_fill_lnkdesc(a4l_cxt_t * cxt,
 
 void a4l_free_lnkdesc(a4l_cxt_t * cxt, a4l_lnkdesc_t * link_arg)
 {
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_free_lnkdesc: minor=%d\n", a4l_get_minor(cxt));
-
        if (link_arg->bname != NULL)
                rtdm_free(link_arg->bname);
 
@@ -301,9 +290,6 @@ int a4l_assign_driver(a4l_cxt_t * cxt,
        int ret = 0;
        a4l_dev_t *dev = a4l_get_dev(cxt);
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_assign_driver: minor=%d\n", a4l_get_minor(cxt));
-
        dev->driver = drv;
 
        if (drv->privdata_size == 0)
@@ -355,9 +341,6 @@ int a4l_release_driver(a4l_cxt_t * cxt)
        int ret = 0;
        a4l_dev_t *dev = a4l_get_dev(cxt);
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_release_driver: minor=%d\n", a4l_get_minor(cxt));
-
        if ((ret = dev->driver->detach(dev)) != 0)
                goto out_release_driver;
 
@@ -388,9 +371,6 @@ int a4l_device_attach(a4l_cxt_t * cxt, void *arg)
        a4l_lnkdesc_t link_arg;
        a4l_drv_t *drv = NULL;
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_device_attach: minor=%d\n", a4l_get_minor(cxt));
-
        if ((ret = a4l_fill_lnkdesc(cxt, &link_arg, arg)) != 0)
                goto out_attach;
 
@@ -412,9 +392,6 @@ int a4l_device_detach(a4l_cxt_t * cxt)
 {
        a4l_dev_t *dev = a4l_get_dev(cxt);
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_device_detach: minor=%d\n", a4l_get_minor(cxt));
-
        if (dev->driver == NULL) {
                __a4l_err("a4l_device_detach: "
                          "incoherent state, driver not reachable\n");
@@ -430,9 +407,6 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
 {
        int ret = 0;
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_ioctl_devcfg: minor=%d\n", a4l_get_minor(cxt));
-
        if (rtdm_in_rt_context())
                return -ENOSYS;
 
@@ -487,9 +461,6 @@ int a4l_ioctl_devinfo(a4l_cxt_t * cxt, void *arg)
        a4l_dvinfo_t info;
        a4l_dev_t *dev = a4l_get_dev(cxt);
 
-       __a4l_dbg(1, core_dbg, 
-                 "a4l_ioctl_devinfo: minor=%d\n", a4l_get_minor(cxt));
-
        memset(&info, 0, sizeof(a4l_dvinfo_t));
 
        if (test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
@@ -498,8 +469,8 @@ int a4l_ioctl_devinfo(a4l_cxt_t * cxt, void *arg)
 
                memcpy(info.board_name, dev->driver->board_name, len);
                info.nb_subd = dev->transfer.nb_subd;
-               info.idx_read_subd = dev->transfer.idx_read_subd;
-               info.idx_write_subd = dev->transfer.idx_write_subd;
+               /* TODO: for API compatibility issue, find the first
+                  read subdevice and write subdevice */
        }
 
        if (rtdm_safe_copy_to_user(cxt->user_info, 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to