From 9b5b06740194c8fa1cddb3aa5fe69fd6f5199bc4 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Wed, 25 Sep 2013 14:23:04 -0600 Subject: ACPI / hotplug: Set kobject name via kobject_add(), not kobject_set_name() Set the kobject name via kobject_add() instead of using kobject_set_name(), which is deprecated per Documentation/kobject.txt. Signed-off-by: Bjorn Helgaas Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sysfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 05306a59aedc..ea685835b834 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -763,12 +763,9 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, goto err_out; kobject_init(&hotplug->kobj, &acpi_hotplug_profile_ktype); - error = kobject_set_name(&hotplug->kobj, "%s", name); - if (error) - goto err_out; hotplug->kobj.parent = hotplug_kobj; - error = kobject_add(&hotplug->kobj, hotplug_kobj, NULL); + error = kobject_add(&hotplug->kobj, hotplug_kobj, "%s", name); if (error) goto err_out; -- cgit v1.2.3 From cae712724161c27f5e8c39bb3946449e1c179881 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Wed, 25 Sep 2013 14:23:12 -0600 Subject: ACPI / hotplug: Don't set kobject parent pointer explicitly kobject_add() sets the parent pointer, so we don't need to do it explicitly. Signed-off-by: Bjorn Helgaas Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sysfs.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index ea685835b834..75432819579c 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -764,7 +764,6 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, kobject_init(&hotplug->kobj, &acpi_hotplug_profile_ktype); - hotplug->kobj.parent = hotplug_kobj; error = kobject_add(&hotplug->kobj, hotplug_kobj, "%s", name); if (error) goto err_out; -- cgit v1.2.3 From acd3e2c99464c0391885d58dbe7c99a11d4c0289 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Wed, 25 Sep 2013 14:23:20 -0600 Subject: ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add() Use kobject_init_and_add() since we have nothing special to do between kobject_init() and kobject_add(). Signed-off-by: Bjorn Helgaas Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sysfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 75432819579c..bb6045c5385b 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -762,9 +762,8 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, if (!hotplug_kobj) goto err_out; - kobject_init(&hotplug->kobj, &acpi_hotplug_profile_ktype); - - error = kobject_add(&hotplug->kobj, hotplug_kobj, "%s", name); + error = kobject_init_and_add(&hotplug->kobj, + &acpi_hotplug_profile_ktype, hotplug_kobj, "%s", name); if (error) goto err_out; -- cgit v1.2.3 From 16ff816d3b5d2b81fcff5ca44eb9a98ac3b604b4 Mon Sep 17 00:00:00 2001 From: Zhang Yanfei Date: Wed, 2 Oct 2013 16:27:37 +0800 Subject: ACPI / memhotplug: Use defined marco METHOD_NAME__STA We already have predefined marco for method name "_STA', so using the marco instead of directly using the string. Signed-off-by: Zhang Yanfei Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_memhotplug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 999adb5499c7..dc0880db909c 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -152,8 +152,9 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) unsigned long long current_status; /* Get device present/absent information from the _STA */ - if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", - NULL, ¤t_status))) + if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, + METHOD_NAME__STA, NULL, + ¤t_status))) return -ENODEV; /* * Check for device status. Device should be -- cgit v1.2.3