[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383780421.1847.50.camel@misato.fc.hp.com>
Date: Wed, 06 Nov 2013 16:27:01 -0700
From: Toshi Kani <toshi.kani@...com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux PCI <linux-pci@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yinghai Lu <yinghai@...nel.org>
Subject: Re: [Update][PATCH 4/6] ACPI / hotplug: Simplify device ejection
routines
On Mon, 2013-11-04 at 14:36 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Simplify handle_root_bridge_removal() and acpi_eject_store() by
> getting rid of struct acpi_eject_event and passing device objects
> directly to async routines executed via acpi_os_hotplug_execute().
:
> static ssize_t
> acpi_eject_store(struct device *d, struct device_attribute *attr,
> const char *buf, size_t count)
> {
> struct acpi_device *acpi_device = to_acpi_device(d);
> - struct acpi_eject_event *ej_event;
> acpi_object_type not_used;
> acpi_status status;
> - int ret;
>
> if (!count || buf[0] != '1')
> return -EINVAL;
> @@ -518,28 +519,17 @@ acpi_eject_store(struct device *d, struc
> if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable)
> return -ENODEV;
>
> - ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
> - if (!ej_event) {
> - ret = -ENOMEM;
> - goto err_out;
> - }
> acpi_evaluate_hotplug_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
> ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
> - ej_event->device = acpi_device;
> - ej_event->event = ACPI_OST_EC_OSPM_EJECT;
> get_device(&acpi_device->dev);
> - status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
> + status = acpi_os_hotplug_execute(acpi_eject_store_work, acpi_device);
> if (ACPI_SUCCESS(status))
> return count;
>
> put_device(&acpi_device->dev);
> - kfree(ej_event);
> - ret = status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN;
Why are you deleting the above line as part of this change?
Thanks,
-Toshi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists