提交 d9202036 编写于 作者: A Aaron Lu 提交者: Tejun Heo

libata: zpodd: eliminate odd_can_poweroff

Now that we can directly get the ACPI device conterpart of the physical
ATA transport device, the odd_can_poweroff can be eliminated.
Signed-off-by: NAaron Lu <aaron.lu@intel.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 c75da205
...@@ -85,21 +85,6 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev) ...@@ -85,21 +85,6 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
return ODD_MECH_TYPE_UNSUPPORTED; return ODD_MECH_TYPE_UNSUPPORTED;
} }
static bool odd_can_poweroff(struct ata_device *ata_dev)
{
acpi_handle handle;
struct acpi_device *acpi_dev;
handle = ata_dev_acpi_handle(ata_dev);
if (!handle)
return false;
if (acpi_bus_get_device(handle, &acpi_dev))
return false;
return acpi_device_can_poweroff(acpi_dev);
}
/* Test if ODD is zero power ready by sense code */ /* Test if ODD is zero power ready by sense code */
static bool zpready(struct ata_device *dev) static bool zpready(struct ata_device *dev)
{ {
...@@ -267,13 +252,11 @@ static void ata_acpi_remove_pm_notifier(struct ata_device *dev) ...@@ -267,13 +252,11 @@ static void ata_acpi_remove_pm_notifier(struct ata_device *dev)
void zpodd_init(struct ata_device *dev) void zpodd_init(struct ata_device *dev)
{ {
struct acpi_device *adev = ACPI_COMPANION(&dev->tdev);
enum odd_mech_type mech_type; enum odd_mech_type mech_type;
struct zpodd *zpodd; struct zpodd *zpodd;
if (dev->zpodd) if (dev->zpodd || !adev || !acpi_device_can_poweroff(adev))
return;
if (!odd_can_poweroff(dev))
return; return;
mech_type = zpodd_get_mech_type(dev); mech_type = zpodd_get_mech_type(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册