]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/rpadlpar_sysfs.c
pciehp: use get_service_data
[linux-2.6] / drivers / pci / hotplug / rpadlpar_sysfs.c
index 9cde367915b6bb72dcb70840dbfd49442f4e8667..a796301ea03fbd3709f15be52f78053bb12380f9 100644 (file)
  */
 #include <linux/kobject.h>
 #include <linux/string.h>
+#include <linux/pci.h>
 #include <linux/pci_hotplug.h>
 #include "rpadlpar.h"
+#include "../pci.h"
 
 #define DLPAR_KOBJ_NAME       "control"
-#define ADD_SLOT_ATTR_NAME    "add_slot"
-#define REMOVE_SLOT_ATTR_NAME "remove_slot"
 
-#define MAX_DRC_NAME_LEN 64
+/* Those two have no quotes because they are passed to __ATTR() which
+ * stringifies the argument (yuck !)
+ */
+#define ADD_SLOT_ATTR_NAME    add_slot
+#define REMOVE_SLOT_ATTR_NAME remove_slot
 
+#define MAX_DRC_NAME_LEN 64
 
 static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr,
                              const char *buf, size_t nbytes)
@@ -108,18 +113,18 @@ int dlpar_sysfs_init(void)
        int error;
 
        dlpar_kobj = kobject_create_and_add(DLPAR_KOBJ_NAME,
-                                           &pci_hotplug_slots_kset->kobj);
+                                           &pci_slots_kset->kobj);
        if (!dlpar_kobj)
                return -EINVAL;
 
        error = sysfs_create_group(dlpar_kobj, &dlpar_attr_group);
        if (error)
-               kobject_unregister(dlpar_kobj);
+               kobject_put(dlpar_kobj);
        return error;
 }
 
 void dlpar_sysfs_exit(void)
 {
        sysfs_remove_group(dlpar_kobj, &dlpar_attr_group);
-       kobject_unregister(dlpar_kobj);
+       kobject_put(dlpar_kobj);
 }