X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=drivers%2Fbase%2Ftransport_class.c;h=84997efdb23d699de42e5c8beadd1724795a1968;hb=f613984902b64cfb05599f9ba52c0af39cb4db6b;hp=f25e7c6b2d27301990eb6bc133015b5889a754e9;hpb=9189674026e86e624b1ef1b4eb430e9ad19f9641;p=cascardo%2Flinux.git diff --git a/drivers/base/transport_class.c b/drivers/base/transport_class.c index f25e7c6b2d27..84997efdb23d 100644 --- a/drivers/base/transport_class.c +++ b/drivers/base/transport_class.c @@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(transport_class_unregister); static int anon_transport_dummy_function(struct transport_container *tc, struct device *dev, - struct class_device *cdev) + struct device *cdev) { /* do nothing */ return 0; @@ -108,13 +108,14 @@ EXPORT_SYMBOL_GPL(anon_transport_class_register); */ void anon_transport_class_unregister(struct anon_transport_class *atc) { - attribute_container_unregister(&atc->container); + if (unlikely(attribute_container_unregister(&atc->container))) + BUG(); } EXPORT_SYMBOL_GPL(anon_transport_class_unregister); static int transport_setup_classdev(struct attribute_container *cont, struct device *dev, - struct class_device *classdev) + struct device *classdev) { struct transport_class *tclass = class_to_transport_class(cont->class); struct transport_container *tcont = attribute_container_to_transport_container(cont); @@ -126,9 +127,7 @@ static int transport_setup_classdev(struct attribute_container *cont, } /** - * transport_setup_device - declare a new dev for transport class association - * but don't make it visible yet. - * + * transport_setup_device - declare a new dev for transport class association but don't make it visible yet. * @dev: the generic device representing the entity being added * * Usually, dev represents some component in the HBA system (either @@ -150,7 +149,7 @@ EXPORT_SYMBOL_GPL(transport_setup_device); static int transport_add_class_device(struct attribute_container *cont, struct device *dev, - struct class_device *classdev) + struct device *classdev) { int error = attribute_container_add_class_device(classdev); struct transport_container *tcont = @@ -182,7 +181,7 @@ EXPORT_SYMBOL_GPL(transport_add_device); static int transport_configure(struct attribute_container *cont, struct device *dev, - struct class_device *cdev) + struct device *cdev) { struct transport_class *tclass = class_to_transport_class(cont->class); struct transport_container *tcont = attribute_container_to_transport_container(cont); @@ -213,7 +212,7 @@ EXPORT_SYMBOL_GPL(transport_configure_device); static int transport_remove_classdev(struct attribute_container *cont, struct device *dev, - struct class_device *classdev) + struct device *classdev) { struct transport_container *tcont = attribute_container_to_transport_container(cont); @@ -252,12 +251,12 @@ EXPORT_SYMBOL_GPL(transport_remove_device); static void transport_destroy_classdev(struct attribute_container *cont, struct device *dev, - struct class_device *classdev) + struct device *classdev) { struct transport_class *tclass = class_to_transport_class(cont->class); if (tclass->remove != anon_transport_dummy_function) - class_device_put(classdev); + put_device(classdev); }