[PATCH] Remove struct device::bus_list.
[deliverable/linux.git] / drivers / base / core.c
index 32f3f09a42e087db4386425920c1aa26ef4aa1f6..f258a21ed78a813da3884664b1ab4c06ead356ec 100644 (file)
@@ -36,7 +36,7 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 {
        struct device_attribute * dev_attr = to_dev_attr(attr);
        struct device * dev = to_dev(kobj);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (dev_attr->show)
                ret = dev_attr->show(dev, buf);
@@ -49,7 +49,7 @@ dev_attr_store(struct kobject * kobj, struct attribute * attr,
 {
        struct device_attribute * dev_attr = to_dev_attr(attr);
        struct device * dev = to_dev(kobj);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (dev_attr->store)
                ret = dev_attr->store(dev, buf, count);
@@ -210,8 +210,8 @@ void device_initialize(struct device *dev)
        INIT_LIST_HEAD(&dev->node);
        INIT_LIST_HEAD(&dev->children);
        INIT_LIST_HEAD(&dev->driver_list);
-       INIT_LIST_HEAD(&dev->bus_list);
        INIT_LIST_HEAD(&dev->dma_pools);
+       init_MUTEX(&dev->sem);
 }
 
 /**
@@ -400,24 +400,6 @@ int device_for_each_child(struct device * dev, void * data,
        return error;
 }
 
-/**
- *     device_find - locate device on a bus by name.
- *     @name:  name of the device.
- *     @bus:   bus to scan for the device.
- *
- *     Call kset_find_obj() to iterate over list of devices on
- *     a bus to find device by name. Return device if found.
- *
- *     Note that kset_find_obj increments device's reference count.
- */
-struct device *device_find(const char *name, struct bus_type *bus)
-{
-       struct kobject *k = kset_find_obj(&bus->devices, name);
-       if (k)
-               return to_dev(k);
-       return NULL;
-}
-
 int __init devices_init(void)
 {
        return subsystem_register(&devices_subsys);
@@ -433,7 +415,6 @@ EXPORT_SYMBOL_GPL(device_del);
 EXPORT_SYMBOL_GPL(device_unregister);
 EXPORT_SYMBOL_GPL(get_device);
 EXPORT_SYMBOL_GPL(put_device);
-EXPORT_SYMBOL_GPL(device_find);
 
 EXPORT_SYMBOL_GPL(device_create_file);
 EXPORT_SYMBOL_GPL(device_remove_file);
This page took 0.026813 seconds and 5 git commands to generate.