diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
commit | 1f16f116b01c110db20ab808562c8b8bc3ee3d6e (patch) | |
tree | 44db563f64cf5f8d62af8f99a61e2b248c44ea3a /drivers/phy/phy-core.c | |
parent | 03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2 (diff) | |
parent | f9eccf24615672896dc13251410c3f2f33a14f95 (diff) |
Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull in fixes from Daniel Lezcano:
- Fix the vt8500 timer leading to a system lock up when dealing with too
small delta (Roman Volkov)
- Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST
(Daniel Lezcano)
- Prevent to compile timers using the 'iomem' API when the architecture has
not HAS_IOMEM set (Richard Weinberger)
Diffstat (limited to 'drivers/phy/phy-core.c')
-rw-r--r-- | drivers/phy/phy-core.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index fc48fac003a6..8c7f27db6ad3 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
@@ -636,8 +636,9 @@ EXPORT_SYMBOL_GPL(devm_of_phy_get); | |||
636 | * @np: node containing the phy | 636 | * @np: node containing the phy |
637 | * @index: index of the phy | 637 | * @index: index of the phy |
638 | * | 638 | * |
639 | * Gets the phy using _of_phy_get(), and associates a device with it using | 639 | * Gets the phy using _of_phy_get(), then gets a refcount to it, |
640 | * devres. On driver detach, release function is invoked on the devres data, | 640 | * and associates a device with it using devres. On driver detach, |
641 | * release function is invoked on the devres data, | ||
641 | * then, devres data is freed. | 642 | * then, devres data is freed. |
642 | * | 643 | * |
643 | */ | 644 | */ |
@@ -651,13 +652,21 @@ struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np, | |||
651 | return ERR_PTR(-ENOMEM); | 652 | return ERR_PTR(-ENOMEM); |
652 | 653 | ||
653 | phy = _of_phy_get(np, index); | 654 | phy = _of_phy_get(np, index); |
654 | if (!IS_ERR(phy)) { | 655 | if (IS_ERR(phy)) { |
655 | *ptr = phy; | ||
656 | devres_add(dev, ptr); | ||
657 | } else { | ||
658 | devres_free(ptr); | 656 | devres_free(ptr); |
657 | return phy; | ||
659 | } | 658 | } |
660 | 659 | ||
660 | if (!try_module_get(phy->ops->owner)) { | ||
661 | devres_free(ptr); | ||
662 | return ERR_PTR(-EPROBE_DEFER); | ||
663 | } | ||
664 | |||
665 | get_device(&phy->dev); | ||
666 | |||
667 | *ptr = phy; | ||
668 | devres_add(dev, ptr); | ||
669 | |||
661 | return phy; | 670 | return phy; |
662 | } | 671 | } |
663 | EXPORT_SYMBOL_GPL(devm_of_phy_get_by_index); | 672 | EXPORT_SYMBOL_GPL(devm_of_phy_get_by_index); |