Driver core: change sysdev classes to use dynamic kobject names

All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Kay Sievers
2007-12-20 02:09:39 +01:00
committed by Greg Kroah-Hartman
parent 528a4bf1d5
commit af5ca3f4ec
55 changed files with 62 additions and 73 deletions
+1 -1
View File
@@ -911,7 +911,7 @@ __setup("acpi_irq_balance", acpi_irq_balance_set);
/* FIXME: we will remove this interface after all drivers call pci_disable_device */
static struct sysdev_class irqrouter_sysdev_class = {
set_kset_name("irqrouter"),
.name = "irqrouter",
.resume = irqrouter_resume,
};
+1 -1
View File
@@ -466,7 +466,6 @@ static struct kset_uevent_ops class_uevent_ops = {
* entirely soon.
*/
static struct kset class_obj_subsys = {
.kobj = { .k_name = "class_obj", },
.uevent_ops = &class_uevent_ops,
};
@@ -872,6 +871,7 @@ int __init classes_init(void)
/* ick, this is ugly, the things we go through to keep from showing up
* in sysfs... */
kset_init(&class_obj_subsys);
kobject_set_name(&class_obj_subsys.kobj, "class_obj");
if (!class_obj_subsys.kobj.parent)
class_obj_subsys.kobj.parent = &class_obj_subsys.kobj;
return 0;
+1 -1
View File
@@ -14,7 +14,7 @@
#include "base.h"
struct sysdev_class cpu_sysdev_class = {
set_kset_name("cpu"),
.name = "cpu",
};
EXPORT_SYMBOL(cpu_sysdev_class);
+1 -1
View File
@@ -26,7 +26,7 @@
#define MEMORY_CLASS_NAME "memory"
static struct sysdev_class memory_sysdev_class = {
set_kset_name(MEMORY_CLASS_NAME),
.name = MEMORY_CLASS_NAME,
};
static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
+1 -1
View File
@@ -15,7 +15,7 @@
#include <linux/device.h>
static struct sysdev_class node_class = {
set_kset_name("node"),
.name = "node",
};
+1
View File
@@ -136,6 +136,7 @@ int sysdev_class_register(struct sysdev_class * cls)
cls->kset.kobj.parent = &system_kset->kobj;
cls->kset.kobj.ktype = &ktype_sysdev_class;
cls->kset.kobj.kset = system_kset;
kobject_set_name(&cls->kset.kobj, cls->name);
return kset_register(&cls->kset);
}
+1 -1
View File
@@ -31,7 +31,7 @@ struct workqueue_struct *edac_workqueue;
* need to export to other files in this modules
*/
static struct sysdev_class edac_class = {
set_kset_name("edac"),
.name = "edac",
};
static int edac_class_valid;
+1 -1
View File
@@ -3451,7 +3451,7 @@ static int kvm_resume(struct sys_device *dev)
}
static struct sysdev_class kvm_sysdev_class = {
set_kset_name("kvm"),
.name = "kvm",
.suspend = kvm_suspend,
.resume = kvm_resume,
};
+1 -1
View File
@@ -2796,7 +2796,7 @@ static int pmu_sys_resume(struct sys_device *sysdev)
#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
static struct sysdev_class pmu_sysclass = {
set_kset_name("pmu"),
.name = "pmu",
};
static struct sys_device device_pmu = {
+1 -1
View File
@@ -464,7 +464,7 @@ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
res = sas_phy_reset(phy, 1);
if (res)
SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
phy->dev.kobj.k_name,
kobject_name(&phy->dev.kobj),
res);
if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
return SUCCESS;