summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-zpodd.c
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-03-14 01:46:10 -0400
committerTejun Heo <tj@kernel.org>2014-03-14 11:23:47 -0400
commitd920203695029558ef16925182f89cf6302b50b0 (patch)
tree660f8bb361fcf9d22d194f7c0fce7bf8f9ac90b5 /drivers/ata/libata-zpodd.c
parentc75da205e02dda3b79ca057e558f97f3d61c855d (diff)
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: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-zpodd.c')
-rw-r--r--drivers/ata/libata-zpodd.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
index 88949c6d55dd..f3a65a3140d3 100644
--- a/drivers/ata/libata-zpodd.c
+++ b/drivers/ata/libata-zpodd.c
@@ -85,21 +85,6 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
85 return ODD_MECH_TYPE_UNSUPPORTED; 85 return ODD_MECH_TYPE_UNSUPPORTED;
86} 86}
87 87
88static bool odd_can_poweroff(struct ata_device *ata_dev)
89{
90 acpi_handle handle;
91 struct acpi_device *acpi_dev;
92
93 handle = ata_dev_acpi_handle(ata_dev);
94 if (!handle)
95 return false;
96
97 if (acpi_bus_get_device(handle, &acpi_dev))
98 return false;
99
100 return acpi_device_can_poweroff(acpi_dev);
101}
102
103/* Test if ODD is zero power ready by sense code */ 88/* Test if ODD is zero power ready by sense code */
104static bool zpready(struct ata_device *dev) 89static bool zpready(struct ata_device *dev)
105{ 90{
@@ -267,13 +252,11 @@ static void ata_acpi_remove_pm_notifier(struct ata_device *dev)
267 252
268void zpodd_init(struct ata_device *dev) 253void zpodd_init(struct ata_device *dev)
269{ 254{
255 struct acpi_device *adev = ACPI_COMPANION(&dev->tdev);
270 enum odd_mech_type mech_type; 256 enum odd_mech_type mech_type;
271 struct zpodd *zpodd; 257 struct zpodd *zpodd;
272 258
273 if (dev->zpodd) 259 if (dev->zpodd || !adev || !acpi_device_can_poweroff(adev))
274 return;
275
276 if (!odd_can_poweroff(dev))
277 return; 260 return;
278 261
279 mech_type = zpodd_get_mech_type(dev); 262 mech_type = zpodd_get_mech_type(dev);