2 * class.c - basic device class management
4 * Copyright (c) 2002-3 Patrick Mochel
5 * Copyright (c) 2002-3 Open Source Development Labs
6 * Copyright (c) 2003-2004 Greg Kroah-Hartman
7 * Copyright (c) 2003-2004 IBM Corp.
9 * This file is released under the GPLv2
13 #include <linux/device.h>
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/string.h>
17 #include <linux/kdev_t.h>
18 #include <linux/err.h>
19 #include <linux/slab.h>
22 extern struct subsystem devices_subsys
;
24 #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
25 #define to_class(obj) container_of(obj, struct class, subsys.kset.kobj)
28 class_attr_show(struct kobject
* kobj
, struct attribute
* attr
, char * buf
)
30 struct class_attribute
* class_attr
= to_class_attr(attr
);
31 struct class * dc
= to_class(kobj
);
35 ret
= class_attr
->show(dc
, buf
);
40 class_attr_store(struct kobject
* kobj
, struct attribute
* attr
,
41 const char * buf
, size_t count
)
43 struct class_attribute
* class_attr
= to_class_attr(attr
);
44 struct class * dc
= to_class(kobj
);
47 if (class_attr
->store
)
48 ret
= class_attr
->store(dc
, buf
, count
);
52 static void class_release(struct kobject
* kobj
)
54 struct class *class = to_class(kobj
);
56 pr_debug("class '%s': release.\n", class->name
);
58 if (class->class_release
)
59 class->class_release(class);
61 pr_debug("class '%s' does not have a release() function, "
62 "be careful\n", class->name
);
65 static struct sysfs_ops class_sysfs_ops
= {
66 .show
= class_attr_show
,
67 .store
= class_attr_store
,
70 static struct kobj_type ktype_class
= {
71 .sysfs_ops
= &class_sysfs_ops
,
72 .release
= class_release
,
75 /* Hotplug events for classes go to the class_obj subsys */
76 static decl_subsys(class, &ktype_class
, NULL
);
79 int class_create_file(struct class * cls
, const struct class_attribute
* attr
)
83 error
= sysfs_create_file(&cls
->subsys
.kset
.kobj
, &attr
->attr
);
89 void class_remove_file(struct class * cls
, const struct class_attribute
* attr
)
92 sysfs_remove_file(&cls
->subsys
.kset
.kobj
, &attr
->attr
);
95 static struct class *class_get(struct class *cls
)
98 return container_of(subsys_get(&cls
->subsys
), struct class, subsys
);
102 static void class_put(struct class * cls
)
105 subsys_put(&cls
->subsys
);
109 static int add_class_attrs(struct class * cls
)
114 if (cls
->class_attrs
) {
115 for (i
= 0; attr_name(cls
->class_attrs
[i
]); i
++) {
116 error
= class_create_file(cls
,&cls
->class_attrs
[i
]);
125 class_remove_file(cls
,&cls
->class_attrs
[i
]);
129 static void remove_class_attrs(struct class * cls
)
133 if (cls
->class_attrs
) {
134 for (i
= 0; attr_name(cls
->class_attrs
[i
]); i
++)
135 class_remove_file(cls
,&cls
->class_attrs
[i
]);
139 int class_register(struct class * cls
)
143 pr_debug("device class '%s': registering\n", cls
->name
);
145 INIT_LIST_HEAD(&cls
->children
);
146 INIT_LIST_HEAD(&cls
->devices
);
147 INIT_LIST_HEAD(&cls
->interfaces
);
148 init_MUTEX(&cls
->sem
);
149 error
= kobject_set_name(&cls
->subsys
.kset
.kobj
, "%s", cls
->name
);
153 subsys_set_kset(cls
, class_subsys
);
155 error
= subsystem_register(&cls
->subsys
);
157 error
= add_class_attrs(class_get(cls
));
163 void class_unregister(struct class * cls
)
165 pr_debug("device class '%s': unregistering\n", cls
->name
);
166 if (cls
->virtual_dir
)
167 kobject_unregister(cls
->virtual_dir
);
168 remove_class_attrs(cls
);
169 subsystem_unregister(&cls
->subsys
);
172 static void class_create_release(struct class *cls
)
174 pr_debug("%s called for %s\n", __FUNCTION__
, cls
->name
);
178 static void class_device_create_release(struct class_device
*class_dev
)
180 pr_debug("%s called for %s\n", __FUNCTION__
, class_dev
->class_id
);
184 /* needed to allow these devices to have parent class devices */
185 static int class_device_create_uevent(struct class_device
*class_dev
,
186 char **envp
, int num_envp
,
187 char *buffer
, int buffer_size
)
189 pr_debug("%s called for %s\n", __FUNCTION__
, class_dev
->class_id
);
194 * class_create - create a struct class structure
195 * @owner: pointer to the module that is to "own" this struct class
196 * @name: pointer to a string for the name of this class.
198 * This is used to create a struct class pointer that can then be used
199 * in calls to class_device_create().
201 * Note, the pointer created here is to be destroyed when finished by
202 * making a call to class_destroy().
204 struct class *class_create(struct module
*owner
, const char *name
)
209 cls
= kzalloc(sizeof(*cls
), GFP_KERNEL
);
217 cls
->class_release
= class_create_release
;
218 cls
->release
= class_device_create_release
;
220 retval
= class_register(cls
);
228 return ERR_PTR(retval
);
232 * class_destroy - destroys a struct class structure
233 * @cls: pointer to the struct class that is to be destroyed
235 * Note, the pointer to be destroyed must have been created with a call
238 void class_destroy(struct class *cls
)
240 if ((cls
== NULL
) || (IS_ERR(cls
)))
243 class_unregister(cls
);
246 /* Class Device Stuff */
248 int class_device_create_file(struct class_device
* class_dev
,
249 const struct class_device_attribute
* attr
)
253 error
= sysfs_create_file(&class_dev
->kobj
, &attr
->attr
);
257 void class_device_remove_file(struct class_device
* class_dev
,
258 const struct class_device_attribute
* attr
)
261 sysfs_remove_file(&class_dev
->kobj
, &attr
->attr
);
264 int class_device_create_bin_file(struct class_device
*class_dev
,
265 struct bin_attribute
*attr
)
269 error
= sysfs_create_bin_file(&class_dev
->kobj
, attr
);
273 void class_device_remove_bin_file(struct class_device
*class_dev
,
274 struct bin_attribute
*attr
)
277 sysfs_remove_bin_file(&class_dev
->kobj
, attr
);
281 class_device_attr_show(struct kobject
* kobj
, struct attribute
* attr
,
284 struct class_device_attribute
* class_dev_attr
= to_class_dev_attr(attr
);
285 struct class_device
* cd
= to_class_dev(kobj
);
288 if (class_dev_attr
->show
)
289 ret
= class_dev_attr
->show(cd
, buf
);
294 class_device_attr_store(struct kobject
* kobj
, struct attribute
* attr
,
295 const char * buf
, size_t count
)
297 struct class_device_attribute
* class_dev_attr
= to_class_dev_attr(attr
);
298 struct class_device
* cd
= to_class_dev(kobj
);
301 if (class_dev_attr
->store
)
302 ret
= class_dev_attr
->store(cd
, buf
, count
);
306 static struct sysfs_ops class_dev_sysfs_ops
= {
307 .show
= class_device_attr_show
,
308 .store
= class_device_attr_store
,
311 static void class_dev_release(struct kobject
* kobj
)
313 struct class_device
*cd
= to_class_dev(kobj
);
314 struct class * cls
= cd
->class;
316 pr_debug("device class '%s': release.\n", cd
->class_id
);
318 kfree(cd
->devt_attr
);
319 cd
->devt_attr
= NULL
;
323 else if (cls
->release
)
326 printk(KERN_ERR
"Class Device '%s' does not have a release() function, "
327 "it is broken and must be fixed.\n",
333 static struct kobj_type ktype_class_device
= {
334 .sysfs_ops
= &class_dev_sysfs_ops
,
335 .release
= class_dev_release
,
338 static int class_uevent_filter(struct kset
*kset
, struct kobject
*kobj
)
340 struct kobj_type
*ktype
= get_ktype(kobj
);
342 if (ktype
== &ktype_class_device
) {
343 struct class_device
*class_dev
= to_class_dev(kobj
);
344 if (class_dev
->class)
350 static const char *class_uevent_name(struct kset
*kset
, struct kobject
*kobj
)
352 struct class_device
*class_dev
= to_class_dev(kobj
);
354 return class_dev
->class->name
;
357 #ifdef CONFIG_SYSFS_DEPRECATED
358 char *make_class_name(const char *name
, struct kobject
*kobj
)
363 size
= strlen(name
) + strlen(kobject_name(kobj
)) + 2;
365 class_name
= kmalloc(size
, GFP_KERNEL
);
367 return ERR_PTR(-ENOMEM
);
369 strcpy(class_name
, name
);
370 strcat(class_name
, ":");
371 strcat(class_name
, kobject_name(kobj
));
375 static int deprecated_class_uevent(char **envp
, int num_envp
, int *cur_index
,
376 char *buffer
, int buffer_size
,
378 struct class_device
*class_dev
)
380 struct device
*dev
= class_dev
->dev
;
386 /* add device, backing this class device (deprecated) */
387 path
= kobject_get_path(&dev
->kobj
, GFP_KERNEL
);
389 add_uevent_var(envp
, num_envp
, cur_index
, buffer
, buffer_size
,
390 cur_len
, "PHYSDEVPATH=%s", path
);
394 add_uevent_var(envp
, num_envp
, cur_index
,
395 buffer
, buffer_size
, cur_len
,
396 "PHYSDEVBUS=%s", dev
->bus
->name
);
399 add_uevent_var(envp
, num_envp
, cur_index
,
400 buffer
, buffer_size
, cur_len
,
401 "PHYSDEVDRIVER=%s", dev
->driver
->name
);
405 static int make_deprecated_class_device_links(struct class_device
*class_dev
)
413 class_name
= make_class_name(class_dev
->class->name
, &class_dev
->kobj
);
414 error
= sysfs_create_link(&class_dev
->dev
->kobj
, &class_dev
->kobj
,
420 static void remove_deprecated_class_device_links(struct class_device
*class_dev
)
427 class_name
= make_class_name(class_dev
->class->name
, &class_dev
->kobj
);
428 sysfs_remove_link(&class_dev
->dev
->kobj
, class_name
);
432 static inline int deprecated_class_uevent(char **envp
, int num_envp
,
433 int *cur_index
, char *buffer
,
434 int buffer_size
, int *cur_len
,
435 struct class_device
*class_dev
)
437 static inline int make_deprecated_class_device_links(struct class_device
*cd
)
439 static void remove_deprecated_class_device_links(struct class_device
*cd
)
443 static int class_uevent(struct kset
*kset
, struct kobject
*kobj
, char **envp
,
444 int num_envp
, char *buffer
, int buffer_size
)
446 struct class_device
*class_dev
= to_class_dev(kobj
);
451 pr_debug("%s - name = %s\n", __FUNCTION__
, class_dev
->class_id
);
453 deprecated_class_uevent(envp
, num_envp
, &i
, buffer
, buffer_size
,
456 if (MAJOR(class_dev
->devt
)) {
457 add_uevent_var(envp
, num_envp
, &i
,
458 buffer
, buffer_size
, &length
,
459 "MAJOR=%u", MAJOR(class_dev
->devt
));
461 add_uevent_var(envp
, num_envp
, &i
,
462 buffer
, buffer_size
, &length
,
463 "MINOR=%u", MINOR(class_dev
->devt
));
466 /* terminate, set to next free slot, shrink available space */
470 buffer
= &buffer
[length
];
471 buffer_size
-= length
;
473 if (class_dev
->uevent
) {
474 /* have the class device specific function add its stuff */
475 retval
= class_dev
->uevent(class_dev
, envp
, num_envp
,
476 buffer
, buffer_size
);
478 pr_debug("class_dev->uevent() returned %d\n", retval
);
479 } else if (class_dev
->class->uevent
) {
480 /* have the class specific function add its stuff */
481 retval
= class_dev
->class->uevent(class_dev
, envp
, num_envp
,
482 buffer
, buffer_size
);
484 pr_debug("class->uevent() returned %d\n", retval
);
490 static struct kset_uevent_ops class_uevent_ops
= {
491 .filter
= class_uevent_filter
,
492 .name
= class_uevent_name
,
493 .uevent
= class_uevent
,
496 static decl_subsys(class_obj
, &ktype_class_device
, &class_uevent_ops
);
499 static int class_device_add_attrs(struct class_device
* cd
)
503 struct class * cls
= cd
->class;
505 if (cls
->class_dev_attrs
) {
506 for (i
= 0; attr_name(cls
->class_dev_attrs
[i
]); i
++) {
507 error
= class_device_create_file(cd
,
508 &cls
->class_dev_attrs
[i
]);
517 class_device_remove_file(cd
,&cls
->class_dev_attrs
[i
]);
521 static void class_device_remove_attrs(struct class_device
* cd
)
524 struct class * cls
= cd
->class;
526 if (cls
->class_dev_attrs
) {
527 for (i
= 0; attr_name(cls
->class_dev_attrs
[i
]); i
++)
528 class_device_remove_file(cd
,&cls
->class_dev_attrs
[i
]);
532 static int class_device_add_groups(struct class_device
* cd
)
538 for (i
= 0; cd
->groups
[i
]; i
++) {
539 error
= sysfs_create_group(&cd
->kobj
, cd
->groups
[i
]);
542 sysfs_remove_group(&cd
->kobj
, cd
->groups
[i
]);
551 static void class_device_remove_groups(struct class_device
* cd
)
555 for (i
= 0; cd
->groups
[i
]; i
++) {
556 sysfs_remove_group(&cd
->kobj
, cd
->groups
[i
]);
561 static ssize_t
show_dev(struct class_device
*class_dev
, char *buf
)
563 return print_dev_t(buf
, class_dev
->devt
);
566 static ssize_t
store_uevent(struct class_device
*class_dev
,
567 const char *buf
, size_t count
)
569 kobject_uevent(&class_dev
->kobj
, KOBJ_ADD
);
573 void class_device_initialize(struct class_device
*class_dev
)
575 kobj_set_kset_s(class_dev
, class_obj_subsys
);
576 kobject_init(&class_dev
->kobj
);
577 INIT_LIST_HEAD(&class_dev
->node
);
580 int class_device_add(struct class_device
*class_dev
)
582 struct class *parent_class
= NULL
;
583 struct class_device
*parent_class_dev
= NULL
;
584 struct class_interface
*class_intf
;
587 class_dev
= class_device_get(class_dev
);
591 if (!strlen(class_dev
->class_id
))
594 parent_class
= class_get(class_dev
->class);
598 parent_class_dev
= class_device_get(class_dev
->parent
);
600 pr_debug("CLASS: registering class device: ID = '%s'\n",
601 class_dev
->class_id
);
603 /* first, register with generic layer. */
604 error
= kobject_set_name(&class_dev
->kobj
, "%s", class_dev
->class_id
);
608 if (parent_class_dev
)
609 class_dev
->kobj
.parent
= &parent_class_dev
->kobj
;
611 class_dev
->kobj
.parent
= &parent_class
->subsys
.kset
.kobj
;
613 error
= kobject_add(&class_dev
->kobj
);
617 /* add the needed attributes to this device */
618 error
= sysfs_create_link(&class_dev
->kobj
,
619 &parent_class
->subsys
.kset
.kobj
, "subsystem");
622 class_dev
->uevent_attr
.attr
.name
= "uevent";
623 class_dev
->uevent_attr
.attr
.mode
= S_IWUSR
;
624 class_dev
->uevent_attr
.attr
.owner
= parent_class
->owner
;
625 class_dev
->uevent_attr
.store
= store_uevent
;
626 error
= class_device_create_file(class_dev
, &class_dev
->uevent_attr
);
630 if (MAJOR(class_dev
->devt
)) {
631 struct class_device_attribute
*attr
;
632 attr
= kzalloc(sizeof(*attr
), GFP_KERNEL
);
637 attr
->attr
.name
= "dev";
638 attr
->attr
.mode
= S_IRUGO
;
639 attr
->attr
.owner
= parent_class
->owner
;
640 attr
->show
= show_dev
;
641 error
= class_device_create_file(class_dev
, attr
);
647 class_dev
->devt_attr
= attr
;
650 error
= class_device_add_attrs(class_dev
);
654 if (class_dev
->dev
) {
655 error
= sysfs_create_link(&class_dev
->kobj
,
656 &class_dev
->dev
->kobj
, "device");
661 error
= class_device_add_groups(class_dev
);
665 error
= make_deprecated_class_device_links(class_dev
);
669 kobject_uevent(&class_dev
->kobj
, KOBJ_ADD
);
671 /* notify any interfaces this device is now here */
672 down(&parent_class
->sem
);
673 list_add_tail(&class_dev
->node
, &parent_class
->children
);
674 list_for_each_entry(class_intf
, &parent_class
->interfaces
, node
) {
676 class_intf
->add(class_dev
, class_intf
);
678 up(&parent_class
->sem
);
683 class_device_remove_groups(class_dev
);
686 sysfs_remove_link(&class_dev
->kobj
, "device");
688 class_device_remove_attrs(class_dev
);
690 if (class_dev
->devt_attr
)
691 class_device_remove_file(class_dev
, class_dev
->devt_attr
);
693 class_device_remove_file(class_dev
, &class_dev
->uevent_attr
);
695 kobject_del(&class_dev
->kobj
);
698 class_device_put(parent_class_dev
);
699 class_put(parent_class
);
701 class_device_put(class_dev
);
705 int class_device_register(struct class_device
*class_dev
)
707 class_device_initialize(class_dev
);
708 return class_device_add(class_dev
);
712 * class_device_create - creates a class device and registers it with sysfs
713 * @cls: pointer to the struct class that this device should be registered to.
714 * @parent: pointer to the parent struct class_device of this new device, if any.
715 * @devt: the dev_t for the char device to be added.
716 * @device: a pointer to a struct device that is assiociated with this class device.
717 * @fmt: string for the class device's name
719 * This function can be used by char device classes. A struct
720 * class_device will be created in sysfs, registered to the specified
722 * A "dev" file will be created, showing the dev_t for the device, if
723 * the dev_t is not 0,0.
724 * If a pointer to a parent struct class_device is passed in, the newly
725 * created struct class_device will be a child of that device in sysfs.
726 * The pointer to the struct class_device will be returned from the
727 * call. Any further sysfs files that might be required can be created
728 * using this pointer.
730 * Note: the struct class passed to this function must have previously
731 * been created with a call to class_create().
733 struct class_device
*class_device_create(struct class *cls
,
734 struct class_device
*parent
,
736 struct device
*device
,
737 const char *fmt
, ...)
740 struct class_device
*class_dev
= NULL
;
741 int retval
= -ENODEV
;
743 if (cls
== NULL
|| IS_ERR(cls
))
746 class_dev
= kzalloc(sizeof(*class_dev
), GFP_KERNEL
);
752 class_dev
->devt
= devt
;
753 class_dev
->dev
= device
;
754 class_dev
->class = cls
;
755 class_dev
->parent
= parent
;
756 class_dev
->release
= class_device_create_release
;
757 class_dev
->uevent
= class_device_create_uevent
;
760 vsnprintf(class_dev
->class_id
, BUS_ID_SIZE
, fmt
, args
);
762 retval
= class_device_register(class_dev
);
770 return ERR_PTR(retval
);
773 void class_device_del(struct class_device
*class_dev
)
775 struct class *parent_class
= class_dev
->class;
776 struct class_device
*parent_device
= class_dev
->parent
;
777 struct class_interface
*class_intf
;
780 down(&parent_class
->sem
);
781 list_del_init(&class_dev
->node
);
782 list_for_each_entry(class_intf
, &parent_class
->interfaces
, node
)
783 if (class_intf
->remove
)
784 class_intf
->remove(class_dev
, class_intf
);
785 up(&parent_class
->sem
);
788 if (class_dev
->dev
) {
789 remove_deprecated_class_device_links(class_dev
);
790 sysfs_remove_link(&class_dev
->kobj
, "device");
792 sysfs_remove_link(&class_dev
->kobj
, "subsystem");
793 class_device_remove_file(class_dev
, &class_dev
->uevent_attr
);
794 if (class_dev
->devt_attr
)
795 class_device_remove_file(class_dev
, class_dev
->devt_attr
);
796 class_device_remove_attrs(class_dev
);
797 class_device_remove_groups(class_dev
);
799 kobject_uevent(&class_dev
->kobj
, KOBJ_REMOVE
);
800 kobject_del(&class_dev
->kobj
);
802 class_device_put(parent_device
);
803 class_put(parent_class
);
806 void class_device_unregister(struct class_device
*class_dev
)
808 pr_debug("CLASS: Unregistering class device. ID = '%s'\n",
809 class_dev
->class_id
);
810 class_device_del(class_dev
);
811 class_device_put(class_dev
);
815 * class_device_destroy - removes a class device that was created with class_device_create()
816 * @cls: the pointer to the struct class that this device was registered * with.
817 * @devt: the dev_t of the device that was previously registered.
819 * This call unregisters and cleans up a class device that was created with a
820 * call to class_device_create()
822 void class_device_destroy(struct class *cls
, dev_t devt
)
824 struct class_device
*class_dev
= NULL
;
825 struct class_device
*class_dev_tmp
;
828 list_for_each_entry(class_dev_tmp
, &cls
->children
, node
) {
829 if (class_dev_tmp
->devt
== devt
) {
830 class_dev
= class_dev_tmp
;
837 class_device_unregister(class_dev
);
840 int class_device_rename(struct class_device
*class_dev
, char *new_name
)
843 char *old_class_name
= NULL
, *new_class_name
= NULL
;
845 class_dev
= class_device_get(class_dev
);
849 pr_debug("CLASS: renaming '%s' to '%s'\n", class_dev
->class_id
,
852 #ifdef CONFIG_SYSFS_DEPRECATED
854 old_class_name
= make_class_name(class_dev
->class->name
,
858 strlcpy(class_dev
->class_id
, new_name
, KOBJ_NAME_LEN
);
860 error
= kobject_rename(&class_dev
->kobj
, new_name
);
862 #ifdef CONFIG_SYSFS_DEPRECATED
863 if (class_dev
->dev
) {
864 new_class_name
= make_class_name(class_dev
->class->name
,
866 sysfs_create_link(&class_dev
->dev
->kobj
, &class_dev
->kobj
,
868 sysfs_remove_link(&class_dev
->dev
->kobj
, old_class_name
);
871 class_device_put(class_dev
);
873 kfree(old_class_name
);
874 kfree(new_class_name
);
879 struct class_device
* class_device_get(struct class_device
*class_dev
)
882 return to_class_dev(kobject_get(&class_dev
->kobj
));
886 void class_device_put(struct class_device
*class_dev
)
889 kobject_put(&class_dev
->kobj
);
893 int class_interface_register(struct class_interface
*class_intf
)
895 struct class *parent
;
896 struct class_device
*class_dev
;
899 if (!class_intf
|| !class_intf
->class)
902 parent
= class_get(class_intf
->class);
907 list_add_tail(&class_intf
->node
, &parent
->interfaces
);
908 if (class_intf
->add
) {
909 list_for_each_entry(class_dev
, &parent
->children
, node
)
910 class_intf
->add(class_dev
, class_intf
);
912 if (class_intf
->add_dev
) {
913 list_for_each_entry(dev
, &parent
->devices
, node
)
914 class_intf
->add_dev(dev
, class_intf
);
921 void class_interface_unregister(struct class_interface
*class_intf
)
923 struct class * parent
= class_intf
->class;
924 struct class_device
*class_dev
;
931 list_del_init(&class_intf
->node
);
932 if (class_intf
->remove
) {
933 list_for_each_entry(class_dev
, &parent
->children
, node
)
934 class_intf
->remove(class_dev
, class_intf
);
936 if (class_intf
->remove_dev
) {
937 list_for_each_entry(dev
, &parent
->devices
, node
)
938 class_intf
->remove_dev(dev
, class_intf
);
945 int __init
classes_init(void)
949 retval
= subsystem_register(&class_subsys
);
953 /* ick, this is ugly, the things we go through to keep from showing up
955 subsystem_init(&class_obj_subsys
);
956 if (!class_obj_subsys
.kset
.subsys
)
957 class_obj_subsys
.kset
.subsys
= &class_obj_subsys
;
961 EXPORT_SYMBOL_GPL(class_create_file
);
962 EXPORT_SYMBOL_GPL(class_remove_file
);
963 EXPORT_SYMBOL_GPL(class_register
);
964 EXPORT_SYMBOL_GPL(class_unregister
);
965 EXPORT_SYMBOL_GPL(class_create
);
966 EXPORT_SYMBOL_GPL(class_destroy
);
968 EXPORT_SYMBOL_GPL(class_device_register
);
969 EXPORT_SYMBOL_GPL(class_device_unregister
);
970 EXPORT_SYMBOL_GPL(class_device_initialize
);
971 EXPORT_SYMBOL_GPL(class_device_add
);
972 EXPORT_SYMBOL_GPL(class_device_del
);
973 EXPORT_SYMBOL_GPL(class_device_get
);
974 EXPORT_SYMBOL_GPL(class_device_put
);
975 EXPORT_SYMBOL_GPL(class_device_create
);
976 EXPORT_SYMBOL_GPL(class_device_destroy
);
977 EXPORT_SYMBOL_GPL(class_device_create_file
);
978 EXPORT_SYMBOL_GPL(class_device_remove_file
);
979 EXPORT_SYMBOL_GPL(class_device_create_bin_file
);
980 EXPORT_SYMBOL_GPL(class_device_remove_bin_file
);
982 EXPORT_SYMBOL_GPL(class_interface_register
);
983 EXPORT_SYMBOL_GPL(class_interface_unregister
);