Module: xenomai-forge
Branch: next
Commit: 193f24b3a489168f592b7f9beeb64b9167873ec4
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=193f24b3a489168f592b7f9beeb64b9167873ec4

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Sep 20 18:45:43 2014 +0200

cobalt/rtdm: align naming on kernel standards

Rename rtdm_device_class to rtdm_driver, since this is basically what
it is.

Some sysfs attributes of devices have been updated to better conform
to the kernel standards as well.

---

 include/cobalt/kernel/rtdm/driver.h     |   33 ++++---
 include/cobalt/kernel/rtdm/fd.h         |    3 +-
 include/cobalt/kernel/rtdm/rtdm.h       |    3 -
 include/cobalt/kernel/rtdm/udd.h        |    4 +-
 kernel/cobalt/posix/memory.c            |   10 +--
 kernel/cobalt/rtdm/core.c               |   80 ++++++++---------
 kernel/cobalt/rtdm/device.c             |  144 ++++++++++++++++---------------
 kernel/cobalt/rtdm/fd.c                 |   44 +++++-----
 kernel/cobalt/rtdm/internal.h           |    6 +-
 kernel/cobalt/trace/cobalt-rtdm.h       |   60 ++++++-------
 kernel/drivers/analogy/rtdm_interface.c |    4 +-
 kernel/drivers/autotune/autotune.c      |    4 +-
 kernel/drivers/can/rtcan_raw.c          |    4 +-
 kernel/drivers/ipc/rtipc.c              |    4 +-
 kernel/drivers/serial/16550A.c          |    4 +-
 kernel/drivers/serial/mpc52xx_uart.c    |    4 +-
 kernel/drivers/serial/rt_imx_uart.c     |    4 +-
 kernel/drivers/testing/rtdmtest.c       |    4 +-
 kernel/drivers/testing/switchtest.c     |    4 +-
 kernel/drivers/testing/timerbench.c     |    4 +-
 kernel/drivers/udd/udd.c                |   28 +++---
 21 files changed, 227 insertions(+), 228 deletions(-)

diff --git a/include/cobalt/kernel/rtdm/driver.h 
b/include/cobalt/kernel/rtdm/driver.h
index 5b566f2..2a9201b 100644
--- a/include/cobalt/kernel/rtdm/driver.h
+++ b/include/cobalt/kernel/rtdm/driver.h
@@ -73,8 +73,7 @@ enum rtdm_selecttype;
 /**
  * Use fixed minor provided in the rtdm_device description for
  * registering. If this flag is absent, the RTDM core assigns minor
- * numbers to devices in order of registration within the class they
- * belong to.
+ * numbers to devices managed by a driver in order of registration.
  */
 #define RTDM_FIXED_MINOR               0x0002
 
@@ -127,7 +126,7 @@ enum rtdm_selecttype {
  *
  * Drivers can attach arbitrary data immediately after the official
  * structure.  The size of this data is provided via
- * rtdm_device_class.context_size during device registration.
+ * rtdm_driver.context_size during device registration.
  */
 struct rtdm_dev_context {
        struct rtdm_fd fd;
@@ -204,7 +203,7 @@ static inline struct rtdm_device *rtdm_fd_device(struct 
rtdm_fd *fd)
  * @brief RTDM profile information
  *
  * This descriptor details the profile information associated to a
- * RTDM device class.
+ * RTDM class of device managed by a driver.
  *
  * @anchor rtdm_profile_info @name RTDM profile information descriptor
  */
@@ -224,12 +223,12 @@ struct rtdm_profile_info {
 };     
 
 /**
- * @brief RTDM device class
+ * @brief RTDM driver
  *
- * This descriptor describes a RTDM device class. The structure holds
+ * This descriptor describes a RTDM device driver. The structure holds
  * runtime data, therefore it must reside in writable memory.
  */
-struct rtdm_device_class {
+struct rtdm_driver {
        /**
         * Class profile information. The RTDM_PROFILE_INFO() macro @b
         * must be used for filling up this field.
@@ -246,8 +245,8 @@ struct rtdm_device_class {
        /** I/O operation handlers */
        struct rtdm_fd_ops ops;
        /**
-        * Count of devices which belong to this class. This value is
-        * used to allocate a chrdev region for named devices.
+        * Count of devices this driver manages. This value is used to
+        * allocate a chrdev region for named devices.
         */
        int device_count;
        /** Reserved area */
@@ -268,7 +267,7 @@ struct rtdm_device_class {
  * @brief Initializer for class profile information.
  *
  * This macro must be used to fill in the @ref rtdm_profile_info
- * "class profile information" field from a RTDM device class.
+ * "class profile information" field from a RTDM driver.
  *
  * @param __name Class name (unquoted).
  *
@@ -299,8 +298,8 @@ struct rtdm_device_class {
  * holds runtime data, therefore it must reside in writable memory.
  */
 struct rtdm_device {
-       /** Device class. */
-       struct rtdm_device_class *class;
+       /** Device driver. */
+       struct rtdm_driver *driver;
        /** Driver definable device data */
        void *device_data;
        /**
@@ -317,11 +316,11 @@ struct rtdm_device {
        const char *label;
        /**
         * Minor number of the device. If RTDM_FIXED_MINOR is present
-        * in the device class flags, the value stored in this field
-        * at registration time is read and used verbatim. Otherwise,
-        * the RTDM core automatically assigns minor numbers to
-        * devices in order of registration within the class they
-        * belong to, storing the resulting values into this field.
+        * in the driver flags, the value stored in this field is used
+        * verbatim by rtdm_dev_register(). Otherwise, the RTDM core
+        * automatically assigns minor numbers to all devices managed
+        * by the driver referred to by @a driver, in order of
+        * registration, storing the resulting values into this field.
         *
         * Device nodes created for named devices in the Linux /dev
         * hierarchy are assigned this minor number.
diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h
index c04cd4d..920b276 100644
--- a/include/cobalt/kernel/rtdm/fd.h
+++ b/include/cobalt/kernel/rtdm/fd.h
@@ -46,8 +46,7 @@ struct xnsys_ppd;
  *
  * The file descriptor carries a device minor information which can be
  * retrieved by a call to rtdm_fd_minor(fd). The minor number can be
- * used for distinguishing several instances of the same rtdm_device
- * class.
+ * used for distinguishing devices managed by a driver.
  *
  * @return 0 on success. On failure, a negative error code is returned.
  *
diff --git a/include/cobalt/kernel/rtdm/rtdm.h 
b/include/cobalt/kernel/rtdm/rtdm.h
index b3a25b4..db1e270 100644
--- a/include/cobalt/kernel/rtdm/rtdm.h
+++ b/include/cobalt/kernel/rtdm/rtdm.h
@@ -35,9 +35,6 @@ int __rtdm_dev_open(const char *path, int oflag);
 int __rtdm_dev_socket(int protocol_family,
                      int socket_type, int protocol);
 
-int
-__rt_dev_ioctl_fallback(struct rtdm_fd *fd, unsigned request, void __user 
*arg);
-
 /*
  * Define RTDM_NO_DEFAULT_USER_API to switch off the default
  * rt_dev_xxx interface when providing a customised user API.
diff --git a/include/cobalt/kernel/rtdm/udd.h b/include/cobalt/kernel/rtdm/udd.h
index a78e428..fcb13aa 100644
--- a/include/cobalt/kernel/rtdm/udd.h
+++ b/include/cobalt/kernel/rtdm/udd.h
@@ -283,9 +283,9 @@ struct udd_device {
                atomic_t event;
                struct udd_signotify signfy;
                struct rtdm_event pulse;
-               struct rtdm_device_class class;
+               struct rtdm_driver driver;
                struct rtdm_device device;
-               struct rtdm_device_class mapper_class;
+               struct rtdm_driver mapper_driver;
                struct rtdm_device mapper;
                char *mapper_name;
                int nr_maps;
diff --git a/kernel/cobalt/posix/memory.c b/kernel/cobalt/posix/memory.c
index f99bb40..6ca9206 100644
--- a/kernel/cobalt/posix/memory.c
+++ b/kernel/cobalt/posix/memory.c
@@ -205,7 +205,7 @@ static int sysmem_ioctl_nrt(struct rtdm_fd *fd,
        return do_sysmem_ioctls(fd, request, arg);
 }
 
-static struct rtdm_device_class umm = {
+static struct rtdm_driver umm_driver = {
        .profile_info   =       RTDM_PROFILE_INFO(umm,
                                                  RTDM_CLASS_MEMORY,
                                                  RTDM_SUBCLASS_GENERIC,
@@ -223,16 +223,16 @@ static struct rtdm_device_class umm = {
 
 static struct rtdm_device umm_devices[] = {
        [ UMM_PRIVATE ] = {
-               .class = &umm,
+               .driver = &umm_driver,
                .label = COBALT_MEMDEV_PRIVATE,
        },
        [ UMM_SHARED ] = {
-               .class = &umm,
+               .driver = &umm_driver,
                .label = COBALT_MEMDEV_SHARED,
        },
 };
 
-static struct rtdm_device_class sysmem = {
+static struct rtdm_driver sysmem_driver = {
        .profile_info   =       RTDM_PROFILE_INFO(sysmem,
                                                  RTDM_CLASS_MEMORY,
                                                  SYS_GLOBAL,
@@ -248,7 +248,7 @@ static struct rtdm_device_class sysmem = {
 };
 
 static struct rtdm_device sysmem_device = {
-       .class = &sysmem,
+       .driver = &sysmem_driver,
        .label = COBALT_MEMDEV_SYS,
 };
 
diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c
index 50b3718..5181bdc 100644
--- a/kernel/cobalt/rtdm/core.c
+++ b/kernel/cobalt/rtdm/core.c
@@ -37,25 +37,25 @@
  * @{
  */
 
-static void cleanup_instance(struct rtdm_device *device,
+static void cleanup_instance(struct rtdm_device *dev,
                             struct rtdm_dev_context *context)
 {
        if (context)
                kfree(context);
 
-       __rtdm_put_device(device);
+       __rtdm_put_device(dev);
 }
 
-void __rt_dev_close(struct rtdm_fd *fd)
+void __rtdm_dev_close(struct rtdm_fd *fd)
 {
        struct rtdm_dev_context *context = rtdm_fd_to_context(fd);
-       struct rtdm_device *device = context->device;
-       struct rtdm_device_class *class = device->class;
+       struct rtdm_device *dev = context->device;
+       struct rtdm_driver *drv = dev->driver;
 
-       if (class->ops.close)
-               class->ops.close(fd);
+       if (drv->ops.close)
+               drv->ops.close(fd);
 
-       cleanup_instance(device, context);
+       cleanup_instance(dev, context);
 }
 
 int __rtdm_anon_getfd(const char *name, int flags)
@@ -68,10 +68,10 @@ void __rtdm_anon_putfd(int ufd)
        __close_fd(current->files, ufd);
 }
 
-static int create_instance(int ufd, struct rtdm_device *device,
+static int create_instance(int ufd, struct rtdm_device *dev,
                           struct rtdm_dev_context **context_ptr)
 {
-       struct rtdm_device_class *class = device->class;
+       struct rtdm_driver *drv = dev->driver;
        struct rtdm_dev_context *context;
 
        /*
@@ -80,32 +80,32 @@ static int create_instance(int ufd, struct rtdm_device 
*device,
         */
        *context_ptr = NULL;
 
-       if ((class->device_flags & RTDM_EXCLUSIVE) != 0 &&
-           atomic_read(&device->refcount) > 1)
+       if ((drv->device_flags & RTDM_EXCLUSIVE) != 0 &&
+           atomic_read(&dev->refcount) > 1)
                return -EBUSY;
 
        context = kmalloc(sizeof(struct rtdm_dev_context) +
-                         class->context_size, GFP_KERNEL);
+                         drv->context_size, GFP_KERNEL);
        if (unlikely(context == NULL))
                return -ENOMEM;
 
-       context->device = device;
+       context->device = dev;
        *context_ptr = context;
 
-       return rtdm_fd_enter(&context->fd, ufd, RTDM_FD_MAGIC, &device->ops);
+       return rtdm_fd_enter(&context->fd, ufd, RTDM_FD_MAGIC, &dev->ops);
 }
 
 int __rtdm_dev_open(const char *path, int oflag)
 {
        struct rtdm_dev_context *context;
-       struct rtdm_device *device;
+       struct rtdm_device *dev;
        struct file *filp;
        int ufd, ret;
 
        secondary_mode_only();
 
-       device = __rtdm_get_namedev(path);
-       if (device == NULL)
+       dev = __rtdm_get_namedev(path);
+       if (dev == NULL)
                return -ENODEV;
 
        ufd = get_unused_fd_flags(oflag);
@@ -120,16 +120,16 @@ int __rtdm_dev_open(const char *path, int oflag)
                goto fail_fopen;
        }
 
-       ret = create_instance(ufd, device, &context);
+       ret = create_instance(ufd, dev, &context);
        if (ret < 0)
                goto fail_create;
 
-       context->fd.minor = device->minor;
+       context->fd.minor = dev->minor;
 
        trace_cobalt_fd_open(current, &context->fd, ufd, oflag);
 
-       if (device->ops.open) {
-               ret = device->ops.open(&context->fd, oflag);
+       if (dev->ops.open) {
+               ret = dev->ops.open(&context->fd, oflag);
                if (!XENO_ASSERT(COBALT, !spltest()))
                        splnone();
                if (ret < 0)
@@ -143,13 +143,13 @@ int __rtdm_dev_open(const char *path, int oflag)
        return ufd;
 
 fail_open:
-       cleanup_instance(device, context);
+       cleanup_instance(dev, context);
 fail_create:
        filp_close(filp, current->files);
 fail_fopen:
        put_unused_fd(ufd);
 fail_fd:
-       __rtdm_put_device(device);
+       __rtdm_put_device(dev);
 
        return ret;
 }
@@ -159,13 +159,13 @@ int __rtdm_dev_socket(int protocol_family, int 
socket_type,
                      int protocol)
 {
        struct rtdm_dev_context *context;
-       struct rtdm_device *device;
+       struct rtdm_device *dev;
        int ufd, ret;
 
        secondary_mode_only();
 
-       device = __rtdm_get_protodev(protocol_family, socket_type);
-       if (device == NULL)
+       dev = __rtdm_get_protodev(protocol_family, socket_type);
+       if (dev == NULL)
                return -EAFNOSUPPORT;
 
        ufd = __rtdm_anon_getfd("[rtdm-socket]", O_RDWR);
@@ -174,14 +174,14 @@ int __rtdm_dev_socket(int protocol_family, int 
socket_type,
                goto fail_getfd;
        }
 
-       ret = create_instance(ufd, device, &context);
+       ret = create_instance(ufd, dev, &context);
        if (ret < 0)
                goto fail_create;
 
        trace_cobalt_fd_socket(current, &context->fd, ufd, protocol_family);
 
-       if (device->ops.socket) {
-               ret = device->ops.socket(&context->fd, protocol);
+       if (dev->ops.socket) {
+               ret = dev->ops.socket(&context->fd, protocol);
                if (!XENO_ASSERT(COBALT, !spltest()))
                        splnone();
                if (ret < 0)
@@ -193,30 +193,30 @@ int __rtdm_dev_socket(int protocol_family, int 
socket_type,
        return ufd;
 
 fail_socket:
-       cleanup_instance(device, context);
+       cleanup_instance(dev, context);
 fail_create:
        __close_fd(current->files, ufd);
 fail_getfd:
-       __rtdm_put_device(device);
+       __rtdm_put_device(dev);
 
        return ret;
 }
 EXPORT_SYMBOL_GPL(__rtdm_dev_socket);
 
-int __rt_dev_ioctl_fallback(struct rtdm_fd *fd, unsigned int request,
-                           void __user *arg)
+int __rtdm_dev_ioctl_core(struct rtdm_fd *fd, unsigned int request,
+                         void __user *arg)
 {
-       struct rtdm_device *device = rtdm_fd_device(fd);
-       struct rtdm_device_class *class = device->class;
+       struct rtdm_device *dev = rtdm_fd_device(fd);
+       struct rtdm_driver *drv = dev->driver;
        struct rtdm_device_info dev_info;
 
        if (fd->magic != RTDM_FD_MAGIC || request != RTIOC_DEVICE_INFO)
                return -ENOSYS;
 
-       dev_info.device_flags = class->device_flags;
-       dev_info.device_class = class->profile_info.class_id;
-       dev_info.device_sub_class = class->profile_info.subclass_id;
-       dev_info.profile_version = class->profile_info.version;
+       dev_info.device_flags = drv->device_flags;
+       dev_info.device_class = drv->profile_info.class_id;
+       dev_info.device_sub_class = drv->profile_info.subclass_id;
+       dev_info.profile_version = drv->profile_info.version;
 
        return rtdm_safe_copy_to_user(fd, arg, &dev_info,  sizeof(dev_info));
 }
diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c
index 494de27..951a35d 100644
--- a/kernel/cobalt/rtdm/device.c
+++ b/kernel/cobalt/rtdm/device.c
@@ -33,10 +33,11 @@
  *
  * Pre-defined classes of real-time devices
  *
- * Device profiles define which operation handlers a driver of a certain class
- * has to implement, which name or protocol it has to register, which IOCTLs
- * it has to provide, and further details. Sub-classes can be defined in order
- * to extend a device profile with more hardware-specific functions.
+ * Device profiles define which operation handlers a driver of a
+ * certain class of devices has to implement, which name or protocol
+ * it has to register, which IOCTLs it has to provide, and further
+ * details. Sub-classes can be defined in order to extend a device
+ * profile with more hardware-specific functions.
  */
 
 /**
@@ -138,21 +139,21 @@ static char *rtdm_devnode(struct device *dev, umode_t 
*mode)
        return kasprintf(GFP_KERNEL, "rtdm/%s", dev_name(dev));
 }
 
-static ssize_t class_id_show(struct device *dev,
-                            struct device_attribute *attr, char *buf)
+static ssize_t profile_show(struct device *kdev,
+                           struct device_attribute *attr, char *buf)
 {
-       struct rtdm_device *device = dev_get_drvdata(dev);
+       struct rtdm_device *device = dev_get_drvdata(kdev);
 
-       return sprintf(buf, "%d/%d\n",
-                      device->class->profile_info.class_id,
-                      device->class->profile_info.subclass_id);
+       return sprintf(buf, "%d,%d\n",
+                      device->driver->profile_info.class_id,
+                      device->driver->profile_info.subclass_id);
 }
-static DEVICE_ATTR_RO(class_id);
+static DEVICE_ATTR_RO(profile);
 
-static ssize_t refcount_show(struct device *dev,
+static ssize_t refcount_show(struct device *kdev,
                             struct device_attribute *attr, char *buf)
 {
-       struct rtdm_device *device = dev_get_drvdata(dev);
+       struct rtdm_device *device = dev_get_drvdata(kdev);
 
        return sprintf(buf, "%d\n", atomic_read(&device->refcount));
 }
@@ -165,54 +166,57 @@ static DEVICE_ATTR_RO(refcount);
                __ret;                          \
        })
 
-static ssize_t flags_show(struct device *dev,
+static ssize_t flags_show(struct device *kdev,
                          struct device_attribute *attr, char *buf)
 {
-       struct rtdm_device *device = dev_get_drvdata(dev);
-       struct rtdm_device_class *class = device->class;
+       struct rtdm_device *device = dev_get_drvdata(kdev);
+       struct rtdm_driver *drv = device->driver;
+
+       return sprintf(buf, "%#x\n", drv->device_flags);
+
+}
+static DEVICE_ATTR_RO(flags);
+
+static ssize_t type_show(struct device *kdev,
+                        struct device_attribute *attr, char *buf)
+{
+       struct rtdm_device *device = dev_get_drvdata(kdev);
+       struct rtdm_driver *drv = device->driver;
        int ret;
 
-       ret = sprintf(buf, "%#x (", class->device_flags);
-       if (class->device_flags & RTDM_NAMED_DEVICE)
-               ret += cat_count(buf, "named");
+       if (drv->device_flags & RTDM_NAMED_DEVICE)
+               ret = cat_count(buf, "named\n");
        else
-               ret += cat_count(buf, "protocol");
-
-       if (class->device_flags & RTDM_EXCLUSIVE)
-               ret += cat_count(buf, ", exclusive");
-               
-       if (class->device_flags & RTDM_SECURE_DEVICE)
-               ret += cat_count(buf, ", secure");
-               
-       ret += cat_count(buf, ")\n");
+               ret = cat_count(buf, "protocol\n");
 
        return ret;
 
 }
-static DEVICE_ATTR_RO(flags);
+static DEVICE_ATTR_RO(type);
 
 static struct attribute *rtdm_attrs[] = {
-       &dev_attr_class_id.attr,
+       &dev_attr_profile.attr,
        &dev_attr_refcount.attr,
        &dev_attr_flags.attr,
+       &dev_attr_type.attr,
        NULL,
 };
 ATTRIBUTE_GROUPS(rtdm);
 
-static int register_device_class(struct rtdm_device_class *class)
+static int register_driver(struct rtdm_driver *drv)
 {
        dev_t rdev;
        int ret;
 
-       if (class->profile_info.magic == RTDM_CLASS_MAGIC) {
-               atomic_inc(&class->refcount);
+       if (drv->profile_info.magic == RTDM_CLASS_MAGIC) {
+               atomic_inc(&drv->refcount);
                return 0;
        }
 
-       if (class->profile_info.magic != ~RTDM_CLASS_MAGIC)
+       if (drv->profile_info.magic != ~RTDM_CLASS_MAGIC)
                return -EINVAL;
 
-       switch (class->device_flags & RTDM_DEVICE_TYPE_MASK) {
+       switch (drv->device_flags & RTDM_DEVICE_TYPE_MASK) {
        case RTDM_NAMED_DEVICE:
        case RTDM_PROTOCOL_DEVICE:
                break;
@@ -220,49 +224,49 @@ static int register_device_class(struct rtdm_device_class 
*class)
                return -EINVAL;
        }
 
-       if (class->device_count <= 0)
+       if (drv->device_count <= 0)
                return -EINVAL;
 
-       if ((class->device_flags & RTDM_NAMED_DEVICE) == 0)
+       if ((drv->device_flags & RTDM_NAMED_DEVICE) == 0)
                goto done;
 
-       ret = alloc_chrdev_region(&rdev, 0, class->device_count,
-                                 class->profile_info.name);
+       ret = alloc_chrdev_region(&rdev, 0, drv->device_count,
+                                 drv->profile_info.name);
        if (ret) {
                printk(XENO_WARN "cannot allocate chrdev region %s[0..%d]\n",
-                      class->profile_info.name, class->device_count - 1);
+                      drv->profile_info.name, drv->device_count - 1);
                return ret;
        }
 
-       cdev_init(&class->named.cdev, &rtdm_dumb_fops);
-       ret = cdev_add(&class->named.cdev, rdev, class->device_count);
+       cdev_init(&drv->named.cdev, &rtdm_dumb_fops);
+       ret = cdev_add(&drv->named.cdev, rdev, drv->device_count);
        if (ret)
                goto fail_cdev;
 
-       class->named.major = MAJOR(rdev);
-       atomic_set(&class->refcount, 1);
+       drv->named.major = MAJOR(rdev);
+       atomic_set(&drv->refcount, 1);
 done:
-       class->profile_info.magic = RTDM_CLASS_MAGIC;
+       drv->profile_info.magic = RTDM_CLASS_MAGIC;
 
        return 0;
 
 fail_cdev:
-       unregister_chrdev_region(rdev, class->device_count);
+       unregister_chrdev_region(rdev, drv->device_count);
 
        return ret;
 }
 
-static void unregister_device_class(struct rtdm_device_class *class)
+static void unregister_driver(struct rtdm_driver *drv)
 {
-       XENO_BUGON(COBALT, class->profile_info.magic != RTDM_CLASS_MAGIC);
+       XENO_BUGON(COBALT, drv->profile_info.magic != RTDM_CLASS_MAGIC);
 
-       if (!atomic_dec_and_test(&class->refcount))
+       if (!atomic_dec_and_test(&drv->refcount))
                return;
 
-       if (class->device_flags & RTDM_NAMED_DEVICE) {
-               cdev_del(&class->named.cdev);
-               unregister_chrdev_region(MKDEV(class->named.major, 0),
-                                        class->device_count);
+       if (drv->device_flags & RTDM_NAMED_DEVICE) {
+               cdev_del(&drv->named.cdev);
+               unregister_chrdev_region(MKDEV(drv->named.major, 0),
+                                        drv->device_count);
        }
 }
 
@@ -277,7 +281,7 @@ static void unregister_device_class(struct 
rtdm_device_class *class)
  *
  * - -EINVAL is returned if the descriptor contains invalid
  * entries. RTDM_PROFILE_INFO() must appear in the list of
- * initializers setting up the class properties.
+ * initializers for the driver properties.
  *
  * - -EEXIST is returned if the specified device name of protocol ID is
  * already in use.
@@ -289,9 +293,9 @@ static void unregister_device_class(struct 
rtdm_device_class *class)
  */
 int rtdm_dev_register(struct rtdm_device *device)
 {
-       struct rtdm_device_class *class;
        int ret, pos, major, minor;
        struct device *kdev = NULL;
+       struct rtdm_driver *drv;
        xnkey_t id;
        dev_t rdev;
        spl_t s;
@@ -304,35 +308,35 @@ int rtdm_dev_register(struct rtdm_device *device)
        down(&nrt_dev_lock);
 
        device->name = NULL;
-       class = device->class;
-       pos = atomic_read(&class->refcount);
-       ret = register_device_class(class);
+       drv = device->driver;
+       pos = atomic_read(&drv->refcount);
+       ret = register_driver(drv);
        if (ret) {
                up(&nrt_dev_lock);
                return ret;
        }
 
-       device->ops = class->ops;
-       if (class->device_flags & RTDM_NAMED_DEVICE)
+       device->ops = drv->ops;
+       if (drv->device_flags & RTDM_NAMED_DEVICE)
                device->ops.socket = (typeof(device->ops.socket))enosys;
        else
                device->ops.open = (typeof(device->ops.open))enosys;
 
        init_waitqueue_head(&device->putwq);
-       device->ops.close = __rt_dev_close; /* Interpose on driver's handler. */
+       device->ops.close = __rtdm_dev_close; /* Interpose on driver's handler. 
*/
        atomic_set(&device->refcount, 0);
 
-       if (class->device_flags & RTDM_FIXED_MINOR) {
+       if (drv->device_flags & RTDM_FIXED_MINOR) {
                minor = device->minor;
-               if (minor < 0 || minor >= class->device_count) {
+               if (minor < 0 || minor >= drv->device_count) {
                        ret = -EINVAL;
                        goto fail;
                }
        } else
                device->minor = minor = pos;
 
-       if (class->device_flags & RTDM_NAMED_DEVICE) {
-               major = class->named.major;
+       if (drv->device_flags & RTDM_NAMED_DEVICE) {
+               major = drv->named.major;
                device->name = kasformat(device->label, minor);
                if (device->name == NULL) {
                        ret = -ENOMEM;
@@ -371,7 +375,7 @@ int rtdm_dev_register(struct rtdm_device *device)
                        goto fail;
                }
 
-               id = get_proto_id(class->protocol_family, class->socket_type);
+               id = get_proto_id(drv->protocol_family, drv->socket_type);
                xnlock_get_irqsave(&rt_dev_lock, s);
                ret = xnid_enter(&rtdm_protocol_devices, &device->proto.id, id);
                xnlock_put_irqrestore(&rt_dev_lock, s);
@@ -392,7 +396,7 @@ fail:
        if (kdev)
                device_destroy(rtdm_class, rdev);
 
-       unregister_device_class(class);
+       unregister_driver(drv);
 
        up(&nrt_dev_lock);
 
@@ -415,7 +419,7 @@ EXPORT_SYMBOL_GPL(rtdm_dev_register);
  */
 void rtdm_dev_unregister(struct rtdm_device *device)
 {
-       struct rtdm_device_class *class = device->class;
+       struct rtdm_driver *drv = device->driver;
        xnhandle_t handle = XN_NO_HANDLE;
        spl_t s;
 
@@ -433,7 +437,7 @@ void rtdm_dev_unregister(struct rtdm_device *device)
        down(&nrt_dev_lock);
        xnlock_get_irqsave(&rt_dev_lock, s);
 
-       if (class->device_flags & RTDM_NAMED_DEVICE) {
+       if (drv->device_flags & RTDM_NAMED_DEVICE) {
                handle = device->named.handle;
                list_del(&device->named.entry);
        } else
@@ -446,7 +450,7 @@ void rtdm_dev_unregister(struct rtdm_device *device)
 
        device_destroy(rtdm_class, device->rdev);
 
-       unregister_device_class(class);
+       unregister_driver(drv);
 
        up(&nrt_dev_lock);
 
diff --git a/kernel/cobalt/rtdm/fd.c b/kernel/cobalt/rtdm/fd.c
index b911982..38e712c 100644
--- a/kernel/cobalt/rtdm/fd.c
+++ b/kernel/cobalt/rtdm/fd.c
@@ -33,7 +33,7 @@
 #include "internal.h"
 #include "posix/process.h"
 
-DEFINE_PRIVATE_XNLOCK(__rtdm_fd_lock);
+DEFINE_PRIVATE_XNLOCK(fdtree_lock);
 static LIST_HEAD(rtdm_fd_cleanup_queue);
 static struct semaphore rtdm_fd_cleanup_sem;
 
@@ -150,9 +150,9 @@ int rtdm_fd_enter(struct rtdm_fd *fd, int ufd, unsigned int 
magic,
 
        idx->fd = fd;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        ret = xnid_enter(&ppd->fds, &idx->id, ufd);
-       xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+       xnlock_put_irqrestore(&fdtree_lock, s);
        if (ret < 0) {
                kfree(idx);
                ret = -EBUSY;
@@ -181,7 +181,7 @@ struct rtdm_fd *rtdm_fd_get(int ufd, unsigned int magic)
        struct rtdm_fd *fd;
        spl_t s;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        fd = fetch_fd(p, ufd);
        if (fd == NULL || (magic != 0 && fd->magic != magic)) {
                fd = ERR_PTR(-EBADF);
@@ -190,7 +190,7 @@ struct rtdm_fd *rtdm_fd_get(int ufd, unsigned int magic)
 
        ++fd->refs;
 out:
-       xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+       xnlock_put_irqrestore(&fdtree_lock, s);
 
        return fd;
 }
@@ -216,11 +216,11 @@ static int fd_cleanup_thread(void *data)
                if (kthread_should_stop())
                        break;
 
-               xnlock_get_irqsave(&__rtdm_fd_lock, s);
+               xnlock_get_irqsave(&fdtree_lock, s);
                fd = list_first_entry(&rtdm_fd_cleanup_queue,
                                struct rtdm_fd, cleanup);
                list_del(&fd->cleanup);
-               xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+               xnlock_put_irqrestore(&fdtree_lock, s);
 
                fd->ops->close(fd);
        }
@@ -238,7 +238,7 @@ static void __put_fd(struct rtdm_fd *fd, spl_t s)
        int destroy;
 
        destroy = --fd->refs == 0;
-       xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+       xnlock_put_irqrestore(&fdtree_lock, s);
 
        if (!destroy)
                return;
@@ -253,9 +253,9 @@ static void __put_fd(struct rtdm_fd *fd, spl_t s)
                        },
                };
 
-               xnlock_get_irqsave(&__rtdm_fd_lock, s);
+               xnlock_get_irqsave(&fdtree_lock, s);
                list_add_tail(&fd->cleanup, &rtdm_fd_cleanup_queue);
-               xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+               xnlock_put_irqrestore(&fdtree_lock, s);
 
                ipipe_post_work_root(&closework, work);
        }
@@ -275,7 +275,7 @@ void rtdm_fd_put(struct rtdm_fd *fd)
 {
        spl_t s;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        __put_fd(fd, s);
 }
 EXPORT_SYMBOL_GPL(rtdm_fd_put);
@@ -298,13 +298,13 @@ int rtdm_fd_lock(struct rtdm_fd *fd)
 {
        spl_t s;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        if (fd->refs == 0) {
-               xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+               xnlock_put_irqrestore(&fdtree_lock, s);
                return -EIDRM;
        }
        ++fd->refs;
-       xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+       xnlock_put_irqrestore(&fdtree_lock, s);
 
        return 0;
 }
@@ -324,7 +324,7 @@ void rtdm_fd_unlock(struct rtdm_fd *fd)
 {
        spl_t s;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        /* Warn if fd was unreferenced. */
        XENO_ASSERT(COBALT, fd->refs > 0);
        __put_fd(fd, s);
@@ -336,7 +336,7 @@ int rtdm_fd_ioctl(int ufd, unsigned int request, ...)
        void __user *arg;
        struct rtdm_fd *fd;
        va_list args;
-       int err;
+       int err, ret;
 
        va_start(args, request);
        arg = va_arg(args, void __user *);
@@ -359,7 +359,7 @@ int rtdm_fd_ioctl(int ufd, unsigned int request, ...)
                    splnone();
 
        if (err < 0) {
-               int ret = __rt_dev_ioctl_fallback(fd, request, arg);
+               ret = __rtdm_dev_ioctl_core(fd, request, arg);
                if (ret != -ENOSYS)
                        err = ret;
        }
@@ -516,7 +516,7 @@ int rtdm_fd_close(int ufd, unsigned int magic)
 
        ppd = cobalt_ppd_get(0);
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        idx = fetch_fd_index(ppd, ufd);
        if (idx == NULL)
                goto ebadf;
@@ -524,7 +524,7 @@ int rtdm_fd_close(int ufd, unsigned int magic)
        fd = idx->fd;
        if (magic != 0 && fd->magic != magic) {
 ebadf:
-               xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+               xnlock_put_irqrestore(&fdtree_lock, s);
                return -EBADF;
        }
 
@@ -581,9 +581,9 @@ int rtdm_fd_valid_p(int ufd)
        struct rtdm_fd *fd;
        spl_t s;
 
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        fd = fetch_fd(cobalt_ppd_get(0), ufd);
-       xnlock_put_irqrestore(&__rtdm_fd_lock, s);
+       xnlock_put_irqrestore(&fdtree_lock, s);
 
        return fd != NULL;
 }
@@ -634,7 +634,7 @@ static void destroy_fd(void *cookie, struct xnid *id)
        spl_t s;
 
        idx = container_of(id, struct rtdm_fd_index, id);
-       xnlock_get_irqsave(&__rtdm_fd_lock, s);
+       xnlock_get_irqsave(&fdtree_lock, s);
        __fd_close(p, idx, 0);
 }
 
diff --git a/kernel/cobalt/rtdm/internal.h b/kernel/cobalt/rtdm/internal.h
index e3ba70f..58c8f93 100644
--- a/kernel/cobalt/rtdm/internal.h
+++ b/kernel/cobalt/rtdm/internal.h
@@ -47,10 +47,10 @@ struct rtdm_device *__rtdm_get_namedev(const char *path);
 struct rtdm_device *__rtdm_get_protodev(int protocol_family,
                                        int socket_type);
 
-void __rt_dev_close(struct rtdm_fd *fd);
+void __rtdm_dev_close(struct rtdm_fd *fd);
 
-int __rt_dev_ioctl_fallback(struct rtdm_fd *fd,
-                           unsigned int request, void __user *arg);
+int __rtdm_dev_ioctl_core(struct rtdm_fd *fd,
+                         unsigned int request, void __user *arg);
 
 int __rtdm_mmap_from_fdop(struct rtdm_fd *fd, size_t len, off_t offset,
                          int prot, int flags, void *__user *pptr);
diff --git a/kernel/cobalt/trace/cobalt-rtdm.h 
b/kernel/cobalt/trace/cobalt-rtdm.h
index b1e7289..953e89f 100644
--- a/kernel/cobalt/trace/cobalt-rtdm.h
+++ b/kernel/cobalt/trace/cobalt-rtdm.h
@@ -21,17 +21,17 @@ DECLARE_EVENT_CLASS(fd_event,
        TP_ARGS(fd, ufd),
 
        TP_STRUCT__entry(
-               __field(struct rtdm_device *, device)
+               __field(struct rtdm_device *, dev)
                __field(int, ufd)
        ),
 
        TP_fast_assign(
-               __entry->device = rtdm_fd_to_context(fd)->device;
+               __entry->dev = rtdm_fd_to_context(fd)->device;
                __entry->ufd = ufd;
        ),
 
        TP_printk("device=%p fd=%d",
-                 __entry->device, __entry->ufd)
+                 __entry->dev, __entry->ufd)
 );
 
 DECLARE_EVENT_CLASS(fd_request,
@@ -42,7 +42,7 @@ DECLARE_EVENT_CLASS(fd_request,
        TP_STRUCT__entry(
                __array(char, comm, TASK_COMM_LEN)
                __field(pid_t, pid)
-               __field(struct rtdm_device *, device)
+               __field(struct rtdm_device *, dev)
                __field(int, ufd)
                __field(unsigned long, arg)
        ),
@@ -50,13 +50,13 @@ DECLARE_EVENT_CLASS(fd_request,
        TP_fast_assign(
                memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
                __entry->pid = task->pid;
-               __entry->device = rtdm_fd_to_context(fd)->device;
+               __entry->dev = rtdm_fd_to_context(fd)->device;
                __entry->ufd = ufd;
                __entry->arg = arg;
        ),
 
        TP_printk("device=%p fd=%d arg=%#lx pid=%d comm=%s",
-                 __entry->device, __entry->ufd, __entry->arg,
+                 __entry->dev, __entry->ufd, __entry->arg,
                  __entry->pid, __entry->comm)
 );
 
@@ -68,19 +68,19 @@ DECLARE_EVENT_CLASS(fd_request_status,
        TP_STRUCT__entry(
                __array(char, comm, TASK_COMM_LEN)
                __field(pid_t, pid)
-               __field(struct rtdm_device *, device)
+               __field(struct rtdm_device *, dev)
                __field(int, ufd)
        ),
 
        TP_fast_assign(
                memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
                __entry->pid = task->pid;
-               __entry->device = rtdm_fd_to_context(fd)->device;
+               __entry->dev    = rtdm_fd_to_context(fd)->device;
                __entry->ufd = ufd;
        ),
 
        TP_printk("device=%p fd=%d pid=%d comm=%s",
-                 __entry->device, __entry->ufd, __entry->pid, __entry->comm)
+                 __entry->dev, __entry->ufd, __entry->pid, __entry->comm)
 );
 
 DECLARE_EVENT_CLASS(task_op,
@@ -146,12 +146,12 @@ DECLARE_EVENT_CLASS(mutex_op,
 );
 
 TRACE_EVENT(cobalt_device_register,
-       TP_PROTO(struct rtdm_device *device),
-       TP_ARGS(device),
+       TP_PROTO(struct rtdm_device *dev),
+       TP_ARGS(dev),
 
        TP_STRUCT__entry(
-               __field(struct rtdm_device *, device)
-               __string(device_name, device->name)
+               __field(struct rtdm_device *, dev)
+               __string(device_name, dev->name)
                __field(int, flags)
                __field(int, class_id)
                __field(int, subclass_id)
@@ -159,38 +159,38 @@ TRACE_EVENT(cobalt_device_register,
        ),
 
        TP_fast_assign(
-               __entry->device = device;
-               __assign_str(device_name, device->name);
-               __entry->flags = device->class->device_flags;
-               __entry->class_id = device->class->profile_info.class_id;
-               __entry->subclass_id = device->class->profile_info.subclass_id;
-               __entry->profile_version = device->class->profile_info.version;
+               __entry->dev    = dev;
+               __assign_str(device_name, dev->name);
+               __entry->flags = dev->driver->device_flags;
+               __entry->class_id = dev->driver->profile_info.class_id;
+               __entry->subclass_id = dev->driver->profile_info.subclass_id;
+               __entry->profile_version = dev->driver->profile_info.version;
        ),
 
        TP_printk("%s device %s=%p flags=0x%x, class=%d.%d profile=%d",
                  (__entry->flags & RTDM_DEVICE_TYPE_MASK)
                  == RTDM_NAMED_DEVICE ? "named" : "protocol",
-                 __get_str(device_name), __entry->device,
+                 __get_str(device_name), __entry->dev,
                  __entry->flags, __entry->class_id, __entry->subclass_id,
                  __entry->profile_version)
 );
 
 TRACE_EVENT(cobalt_device_unregister,
-       TP_PROTO(struct rtdm_device *device),
-       TP_ARGS(device),
+       TP_PROTO(struct rtdm_device *dev),
+       TP_ARGS(dev),
 
        TP_STRUCT__entry(
-               __field(struct rtdm_device *, device)
-               __string(device_name, device->name)
+               __field(struct rtdm_device *, dev)
+               __string(device_name, dev->name)
        ),
 
        TP_fast_assign(
-               __entry->device = device;
-               __assign_str(device_name, device->name);
+               __entry->dev    = dev;
+               __assign_str(device_name, dev->name);
        ),
 
        TP_printk("device %s=%p",
-                 __get_str(device_name), __entry->device)
+                 __get_str(device_name), __entry->dev)
 );
 
 DEFINE_EVENT(fd_event, cobalt_fd_created,
@@ -280,7 +280,7 @@ TRACE_EVENT(cobalt_fd_mmap,
        TP_STRUCT__entry(
                __array(char, comm, TASK_COMM_LEN)
                __field(pid_t, pid)
-               __field(struct rtdm_device *, device)
+               __field(struct rtdm_device *, dev)
                __field(int, ufd)
                __field(size_t, length)
                __field(off_t, offset)
@@ -291,7 +291,7 @@ TRACE_EVENT(cobalt_fd_mmap,
        TP_fast_assign(
                memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
                __entry->pid = task->pid;
-               __entry->device = rtdm_fd_to_context(fd)->device;
+               __entry->dev = rtdm_fd_to_context(fd)->device;
                __entry->ufd = ufd;
                __entry->length = rma->length;
                __entry->offset = rma->offset;
@@ -301,7 +301,7 @@ TRACE_EVENT(cobalt_fd_mmap,
 
        TP_printk("device=%p fd=%d area={ len:%Zu, off:%Lu }"
                  " prot=%#x(%s) flags=%#x(%s) pid=%d comm=%s",
-                 __entry->device, __entry->ufd, __entry->length,
+                 __entry->dev, __entry->ufd, __entry->length,
                  (unsigned long long)__entry->offset,
                  __entry->prot, cobalt_print_protbits(__entry->prot),
                  __entry->flags, cobalt_print_mapbits(__entry->flags),
diff --git a/kernel/drivers/analogy/rtdm_interface.c 
b/kernel/drivers/analogy/rtdm_interface.c
index 9af877e..23fd7b3 100644
--- a/kernel/drivers/analogy/rtdm_interface.c
+++ b/kernel/drivers/analogy/rtdm_interface.c
@@ -217,7 +217,7 @@ int a4l_rt_select(struct rtdm_fd *fd,
        return a4l_select(cxt, selector, type, fd_index);
 }
 
-static struct rtdm_device_class analogy = {
+static struct rtdm_driver analogy_driver = {
        .profile_info =         RTDM_PROFILE_INFO(analogy,
                                                  RTDM_CLASS_EXPERIMENTAL,
                                                  RTDM_SUBCLASS_ANALOGY,
@@ -240,7 +240,7 @@ static struct rtdm_device_class analogy = {
 
 static struct rtdm_device rtdm_devs[A4L_NB_DEVICES] = {
        [0 ... A4L_NB_DEVICES - 1] = {
-               .class = &analogy,
+               .driver = &analogy_driver,
                .label = "analogy%d",
        }
 };
diff --git a/kernel/drivers/autotune/autotune.c 
b/kernel/drivers/autotune/autotune.c
index fc14cdf..0b4204a 100644
--- a/kernel/drivers/autotune/autotune.c
+++ b/kernel/drivers/autotune/autotune.c
@@ -631,7 +631,7 @@ static void autotune_close(struct rtdm_fd *fd)
                tuner->destroy_tuner(tuner);
 }
 
-static struct rtdm_device_class autotune = {
+static struct rtdm_driver autotune_driver = {
        .profile_info           =       RTDM_PROFILE_INFO(autotune,
                                                          RTDM_CLASS_AUTOTUNE,
                                                          
RTDM_SUBCLASS_AUTOTUNE,
@@ -648,7 +648,7 @@ static struct rtdm_device_class autotune = {
 };
 
 static struct rtdm_device device = {
-       .class = &autotune,
+       .driver = &autotune_driver,
        .label = "autotune",
 };
 
diff --git a/kernel/drivers/can/rtcan_raw.c b/kernel/drivers/can/rtcan_raw.c
index 055e75f..135ca4d 100644
--- a/kernel/drivers/can/rtcan_raw.c
+++ b/kernel/drivers/can/rtcan_raw.c
@@ -976,7 +976,7 @@ ssize_t rtcan_raw_sendmsg(struct rtdm_fd *fd,
 }
 
 
-static struct rtdm_device_class rtcan = {
+static struct rtdm_driver rtcan_driver = {
        .profile_info           = RTDM_PROFILE_INFO(rtcan,
                                                    RTDM_CLASS_CAN,
                                                    RTDM_SUBCLASS_GENERIC,
@@ -997,7 +997,7 @@ static struct rtdm_device_class rtcan = {
 };
 
 static struct rtdm_device rtcan_device = {
-       .class = &rtcan,
+       .driver = &rtcan_driver,
        .label = "rtcan",
 };
 
diff --git a/kernel/drivers/ipc/rtipc.c b/kernel/drivers/ipc/rtipc.c
index 83808cc..c0ea808 100644
--- a/kernel/drivers/ipc/rtipc.c
+++ b/kernel/drivers/ipc/rtipc.c
@@ -256,7 +256,7 @@ static int rtipc_select(struct rtdm_fd *fd, struct 
xnselector *selector,
        return ret;
 }
 
-static struct rtdm_device_class rtipc = {
+static struct rtdm_driver rtipc_driver = {
        .profile_info           =       RTDM_PROFILE_INFO(rtipc,
                                                          RTDM_CLASS_RTIPC,
                                                          RTDM_SUBCLASS_GENERIC,
@@ -284,7 +284,7 @@ static struct rtdm_device_class rtipc = {
 };
 
 static struct rtdm_device device = {
-       .class = &rtipc,
+       .driver = &rtipc_driver,
        .label = "rtipc",
 };
 
diff --git a/kernel/drivers/serial/16550A.c b/kernel/drivers/serial/16550A.c
index 004e5a1..24415cf 100644
--- a/kernel/drivers/serial/16550A.c
+++ b/kernel/drivers/serial/16550A.c
@@ -1066,7 +1066,7 @@ ssize_t rt_16550_write(struct rtdm_fd *fd, const void 
*buf, size_t nbyte)
        return ret;
 }
 
-static struct rtdm_device_class uart16550A = {
+static struct rtdm_driver uart16550A_driver = {
        .profile_info           = RTDM_PROFILE_INFO(uart16550A,
                                                    RTDM_CLASS_SERIAL,
                                                    RTDM_SUBCLASS_16550A,
@@ -1115,7 +1115,7 @@ int __init rt_16550_init(void)
                if (!dev)
                        goto cleanup_out;
 
-               dev->class = &uart16550A;
+               dev->driver = &uart16550A_driver;
                dev->label = "rtser%d";
                name = (char *)(dev + 1);
                ksformat(name, RTDM_MAX_DEVNAME_LEN, dev->label, i);
diff --git a/kernel/drivers/serial/mpc52xx_uart.c 
b/kernel/drivers/serial/mpc52xx_uart.c
index 2a75707..464afc7 100644
--- a/kernel/drivers/serial/mpc52xx_uart.c
+++ b/kernel/drivers/serial/mpc52xx_uart.c
@@ -1234,7 +1234,7 @@ static ssize_t rt_mpc52xx_uart_write(struct rtdm_fd *fd,
        return ret;
 }
 
-static struct rtdm_device_class mpc52xx_uart = {
+static struct rtdm_driver mpc52xx_uart_driver = {
        .profile_info           = RTDM_PROFILE_INFO(imx_uart,
                                                    RTDM_CLASS_SERIAL,
                                                    RTDM_SUBCLASS_16550A,
@@ -1325,7 +1325,7 @@ static int rt_mpc52xx_uart_of_probe(struct 
platform_device *op)
                goto out_dispose_irq_mapping;
        }
 
-       dev->class = &mpc52xx_uart;
+       dev->driver = &mpc52xx_uart_driver;
        dev->label = "rtserPSC%d";
        dev->device_data = port;
 
diff --git a/kernel/drivers/serial/rt_imx_uart.c 
b/kernel/drivers/serial/rt_imx_uart.c
index d01139f..092cecc 100644
--- a/kernel/drivers/serial/rt_imx_uart.c
+++ b/kernel/drivers/serial/rt_imx_uart.c
@@ -1364,7 +1364,7 @@ static ssize_t rt_imx_uart_write(struct rtdm_fd *fd, 
const void *buf,
        return ret;
 }
 
-static struct rtdm_device imx_uart = {
+static struct rtdm_driver imx_uart_driver = {
        .profile_info           = RTDM_PROFILE_INFO(imx_uart,
                                                    RTDM_CLASS_SERIAL,
                                                    RTDM_SUBCLASS_16550A,
@@ -1420,7 +1420,7 @@ static int rt_imx_uart_probe(struct platform_device *pdev)
 
 
        dev = &port->rtdm_dev;
-       dev->class = &imx_uart;
+       dev->driver = &imx_uart_driver;
        dev->label = "rtser%d";
        dev->device_data = port;
 
diff --git a/kernel/drivers/testing/rtdmtest.c 
b/kernel/drivers/testing/rtdmtest.c
index 1510d80..c5224d0 100644
--- a/kernel/drivers/testing/rtdmtest.c
+++ b/kernel/drivers/testing/rtdmtest.c
@@ -102,7 +102,7 @@ rtdm_test_ioctl(struct rtdm_fd *fd, unsigned int request, 
void __user *arg)
        return err;
 }
 
-static struct rtdm_device_class rtdmtest = {
+static struct rtdm_driver rtdmtest_driver = {
        .profile_info           = RTDM_PROFILE_INFO(rtdmtest,
                                                    RTDM_CLASS_TESTING,
                                                    RTDM_SUBCLASS_RTDMTEST,
@@ -120,7 +120,7 @@ static struct rtdm_device_class rtdmtest = {
 
 static struct rtdm_device device[2] = {
        [0 ... 1] = {
-               .class = &rtdmtest,
+               .driver = &rtdmtest_driver,
                .label = "rtdm%d",
        }
 };
diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 1a71126..804c35b 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -717,7 +717,7 @@ static int rtswitch_ioctl_rt(struct rtdm_fd *fd,
        }
 }
 
-static struct rtdm_device_class switchtest = {
+static struct rtdm_driver switchtest_driver = {
        .profile_info = RTDM_PROFILE_INFO(switchtest,
                                          RTDM_CLASS_TESTING,
                                          RTDM_SUBCLASS_SWITCHTEST,
@@ -734,7 +734,7 @@ static struct rtdm_device_class switchtest = {
 };
 
 static struct rtdm_device device = {
-       .class = &switchtest,
+       .driver = &switchtest_driver,
        .label = "switchtest",
 };
 
diff --git a/kernel/drivers/testing/timerbench.c 
b/kernel/drivers/testing/timerbench.c
index 4cd02cd..38b7670 100644
--- a/kernel/drivers/testing/timerbench.c
+++ b/kernel/drivers/testing/timerbench.c
@@ -450,7 +450,7 @@ static int rt_tmbench_ioctl_rt(struct rtdm_fd *fd,
        return err;
 }
 
-static struct rtdm_device_class timerbench = {
+static struct rtdm_driver timerbench_driver = {
        .profile_info           = RTDM_PROFILE_INFO(timerbench,
                                                    RTDM_CLASS_TESTING,
                                                    RTDM_SUBCLASS_TIMERBENCH,
@@ -467,7 +467,7 @@ static struct rtdm_device_class timerbench = {
 };
 
 static struct rtdm_device device = {
-       .class = &timerbench,
+       .driver = &timerbench_driver,
        .label = "timerbench",
 };
 
diff --git a/kernel/drivers/udd/udd.c b/kernel/drivers/udd/udd.c
index 6e5dd83..9a6ea9f 100644
--- a/kernel/drivers/udd/udd.c
+++ b/kernel/drivers/udd/udd.c
@@ -282,23 +282,23 @@ static inline int register_mapper(struct udd_device *udd)
 {
        struct udd_reserved *ur = &udd->__reserved;
        struct rtdm_device *dev = &ur->mapper;
-       struct rtdm_device_class *class = &ur->mapper_class;
+       struct rtdm_driver *drv = &ur->mapper_driver;
 
        ur->mapper_name = kasformat("%s,mapper%%d", udd->device_name);
        if (ur->mapper_name == NULL)
                return -ENOMEM;
 
-       class->profile_info = (struct rtdm_profile_info)
+       drv->profile_info = (struct rtdm_profile_info)
                RTDM_PROFILE_INFO("mapper", RTDM_CLASS_MEMORY,
                                  RTDM_SUBCLASS_GENERIC, 0);
-       class->device_flags = RTDM_NAMED_DEVICE;
-       class->device_count = UDD_NR_MAPS;
-       class->ops = (struct rtdm_fd_ops){
+       drv->device_flags = RTDM_NAMED_DEVICE;
+       drv->device_count = UDD_NR_MAPS;
+       drv->ops = (struct rtdm_fd_ops){
                .open           =       mapper_open,
                .close          =       mapper_close,
                .mmap           =       mapper_mmap,
        };
-       dev->class = class;
+       dev->driver = drv;
        dev->label = ur->mapper_name;
 
        return rtdm_dev_register(dev);
@@ -336,7 +336,7 @@ int udd_register_device(struct udd_device *udd)
 {
        struct rtdm_device *dev = &udd->__reserved.device;
        struct udd_reserved *ur = &udd->__reserved;
-       struct rtdm_device_class *class = &ur->class;
+       struct rtdm_driver *drv = &ur->driver;
        int ret, n;
 
        if (!realtime_core_enabled())
@@ -354,13 +354,13 @@ int udd_register_device(struct udd_device *udd)
                        return ret;
        }
 
-       class->profile_info = (struct rtdm_profile_info)
+       drv->profile_info = (struct rtdm_profile_info)
                RTDM_PROFILE_INFO(udd->device_name, RTDM_CLASS_UDD,
                                  udd->device_subclass, 0);
-       class->device_flags = RTDM_NAMED_DEVICE|udd->device_flags;
-       class->device_count = 1;
-       class->context_size = sizeof(struct udd_context);
-       class->ops = (struct rtdm_fd_ops){
+       drv->device_flags = RTDM_NAMED_DEVICE|udd->device_flags;
+       drv->device_count = 1;
+       drv->context_size = sizeof(struct udd_context);
+       drv->ops = (struct rtdm_fd_ops){
                .open = udd_open,
                .ioctl_rt = udd_ioctl_rt,
                .read_rt = udd_read_rt,
@@ -369,7 +369,7 @@ int udd_register_device(struct udd_device *udd)
                .select = udd_select,
        };
 
-       dev->class = class;
+       dev->driver = drv;
        dev->label = udd->device_name;
 
        ret = rtdm_dev_register(dev);
@@ -586,7 +586,7 @@ struct udd_device *udd_get_device(struct rtdm_fd *fd)
 {
        struct rtdm_device *dev = rtdm_fd_device(fd);
 
-       if (dev->class->profile_info.class_id == RTDM_CLASS_MEMORY)
+       if (dev->driver->profile_info.class_id == RTDM_CLASS_MEMORY)
                return container_of(dev, struct udd_device, __reserved.mapper);
 
        return container_of(dev, struct udd_device, __reserved.device);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to