Lines Matching +full:zero +full:- +full:initialised
1 // SPDX-License-Identifier: GPL-2.0
3 * transport_class.c - implementation of generic transport classes
6 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
21 * transport class<-----attribute container<----class device
23 * Usually the attribute container is per-HBA, but the design doesn't
38 * transport_class_register - register an initial transport class
40 * @tclass: a pointer to the transport class structure to be initialised
44 * zeros and then generic class must have been initialised with the
53 return class_register(&tclass->class); in transport_class_register()
58 * transport_class_unregister - unregister a previously registered class
67 class_unregister(&tclass->class); in transport_class_unregister()
80 * anon_transport_class_register - register an anonymous class
94 atc->container.class = &atc->tclass.class; in anon_transport_class_register()
95 attribute_container_set_no_classdevs(&atc->container); in anon_transport_class_register()
96 error = attribute_container_register(&atc->container); in anon_transport_class_register()
99 atc->tclass.setup = anon_transport_dummy_function; in anon_transport_class_register()
100 atc->tclass.remove = anon_transport_dummy_function; in anon_transport_class_register()
106 * anon_transport_class_unregister - unregister an anon class
115 if (unlikely(attribute_container_unregister(&atc->container))) in anon_transport_class_unregister()
124 struct transport_class *tclass = class_to_transport_class(cont->class); in transport_setup_classdev()
127 if (tclass->setup) in transport_setup_classdev()
128 tclass->setup(tcont, dev, classdev); in transport_setup_classdev()
134 …* transport_setup_device - declare a new dev for transport class association but don't make it vis…
158 struct transport_class *tclass = class_to_transport_class(cont->class); in transport_add_class_device()
166 if (tcont->statistics) { in transport_add_class_device()
167 error = sysfs_create_group(&classdev->kobj, tcont->statistics); in transport_add_class_device()
177 if (tclass->remove) in transport_add_class_device()
178 tclass->remove(tcont, dev, classdev); in transport_add_class_device()
185 * transport_add_device - declare a new dev for transport class association
206 struct transport_class *tclass = class_to_transport_class(cont->class); in transport_configure()
209 if (tclass->configure) in transport_configure()
210 tclass->configure(tcont, dev, cdev); in transport_configure()
216 * transport_configure_device - configure an already set up device
239 struct transport_class *tclass = class_to_transport_class(cont->class); in transport_remove_classdev()
241 if (tclass->remove) in transport_remove_classdev()
242 tclass->remove(tcont, dev, classdev); in transport_remove_classdev()
244 if (tclass->remove != anon_transport_dummy_function) { in transport_remove_classdev()
245 if (tcont->statistics) in transport_remove_classdev()
246 sysfs_remove_group(&classdev->kobj, tcont->statistics); in transport_remove_classdev()
255 * transport_remove_device - remove the visibility of a device
276 struct transport_class *tclass = class_to_transport_class(cont->class); in transport_destroy_classdev()
278 if (tclass->remove != anon_transport_dummy_function) in transport_destroy_classdev()
284 * transport_destroy_device - destroy a removed device
291 * last reference goes to zero. Note also that the classdev retains a