Currently, the exynos PCIe PHY driver supports only single phy ops making it unusable for other platforms. Add the phy_ops as platform specific device data so as to extend this driver to support all platforms using Samsung PHY. Signed-off-by: Shradha Todi <shradha.t@xxxxxxxxxxx> --- drivers/phy/samsung/phy-exynos-pcie.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/phy/samsung/phy-exynos-pcie.c b/drivers/phy/samsung/phy-exynos-pcie.c index 53c9230c2907..022222a0212a 100644 --- a/drivers/phy/samsung/phy-exynos-pcie.c +++ b/drivers/phy/samsung/phy-exynos-pcie.c @@ -136,6 +136,7 @@ static const struct phy_ops exynos5433_phy_ops = { static const struct of_device_id exynos_pcie_phy_match[] = { { .compatible = "samsung,exynos5433-pcie-phy", + .data = &exynos5433_phy_ops, }, {}, }; @@ -146,6 +147,11 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev) struct exynos_pcie_phy *exynos_phy; struct phy *generic_phy; struct phy_provider *phy_provider; + const struct phy_ops *drv_data; + + drv_data = of_device_get_match_data(dev); + if (!drv_data) + return -ENODEV; exynos_phy = devm_kzalloc(dev, sizeof(*exynos_phy), GFP_KERNEL); if (!exynos_phy) @@ -169,7 +175,7 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev) return PTR_ERR(exynos_phy->fsysreg); } - generic_phy = devm_phy_create(dev, dev->of_node, &exynos5433_phy_ops); + generic_phy = devm_phy_create(dev, dev->of_node, drv_data); if (IS_ERR(generic_phy)) { dev_err(dev, "failed to create PHY\n"); return PTR_ERR(generic_phy); -- 2.49.0