]> git.karo-electronics.de Git - karo-tx-linux.git/commit
libahci_platform: Fail when PHY required but PHY support disabled
authorMikko Perttunen <mperttunen@nvidia.com>
Tue, 17 Jun 2014 12:07:55 +0000 (15:07 +0300)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:26 +0000 (21:17 -0600)
commitf07ff44f2b9b710466aaa2db0630aa8af67d58a4
tree3bbac8bd1d99b4ac64ab9b5c31e110ac0e68e5f5
parentd0a2dbab95ce56761f42da333cdb6db8ee561a69
libahci_platform: Fail when PHY required but PHY support disabled

ahci_platform_get_resources handles resource management for
platform AHCI drivers, including getting a possible PHY
from the device tree. Since not all drivers need a PHY, it
ignores -ENODEV and -ENOSYS from devm_get_phy. However, when
the PHY subsystem is mistakenly disabled, -ENOSYS can be
returned even when a PHY is needed.

This patch modifies the -ENOSYS case to check if a "phys"
device tree node exists. If it exists, then clearly the PHY
subsystem is mistakenly disabled and the driver cannot work,
ahci_platform_get_resources will fail and propagate the error.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from commit acbd573354bb7b7b7a3891018a39f4b3976b0c43)
drivers/ata/libahci_platform.c