summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Gerum <rpm@xenomai.org>2016-11-09 12:48:27 +0100
committerPhilippe Gerum <rpm@xenomai.org>2016-11-09 12:48:27 +0100
commit118db7bca9151b12fd737ee40ff3485109336eaf (patch)
tree0cb58b9682b958c1fc02ebd17297246667a7a9d3
parentbc8afd4291cbf1ececf868f4e57feb5cf3f73a0b (diff)
downloadxenomai-3-118db7bca9151b12fd737ee40ff3485109336eaf.tar.bz2
cobalt/rtdm: device: allow switching device class back to default
Passing NULL to rtdm_drv_set_sysclass() is now allowed, to switch a driver back to creating devices into the default "rtdm" class.
-rw-r--r--kernel/cobalt/rtdm/device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c
index d0df7fa..b174c1b 100644
--- a/kernel/cobalt/rtdm/device.c
+++ b/kernel/cobalt/rtdm/device.c
@@ -575,7 +575,9 @@ EXPORT_SYMBOL_GPL(rtdm_dev_unregister);
575 * 575 *
576 * @param[in] drv Address of the RTDM driver descriptor. 576 * @param[in] drv Address of the RTDM driver descriptor.
577 * 577 *
578 * @param[in] cls Pointer to the kernel device class. 578 * @param[in] cls Pointer to the kernel device class. NULL is allowed
579 * to clear a previous setting, switching back to the default "rtdm"
580 * device class.
579 * 581 *
580 * @return 0 on success, otherwise: 582 * @return 0 on success, otherwise:
581 * 583 *
@@ -592,7 +594,8 @@ EXPORT_SYMBOL_GPL(rtdm_dev_unregister);
592 */ 594 */
593int rtdm_drv_set_sysclass(struct rtdm_driver *drv, struct class *cls) 595int rtdm_drv_set_sysclass(struct rtdm_driver *drv, struct class *cls)
594{ 596{
595 if (drv->profile_info.kdev_class || atomic_read(&drv->refcount)) 597 if ((cls && drv->profile_info.kdev_class) ||
598 atomic_read(&drv->refcount))
596 return -EBUSY; 599 return -EBUSY;
597 600
598 drv->profile_info.kdev_class = cls; 601 drv->profile_info.kdev_class = cls;
Mirror
http://xenomai.org/mirroring-xenomai-git-repositories-with-grokmirror/