Loading Documentation/phy.txt +6 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ unregister the PHY. The PHY driver should create the PHY in order for other peripheral controllers to make use of it. The PHY framework provides 2 APIs to create the PHY. struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); The PHY drivers can use one of the above 2 APIs to create the PHY by passing Loading drivers/phy/phy-core.c +18 −7 Original line number Diff line number Diff line Loading @@ -398,13 +398,20 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args struct phy *phy; struct class_dev_iter iter; struct device_node *node = dev->of_node; struct device_node *child; class_dev_iter_init(&iter, phy_class, NULL, NULL); while ((dev = class_dev_iter_next(&iter))) { phy = to_phy(dev); if (node != phy->dev.of_node) if (node != phy->dev.of_node) { for_each_child_of_node(node, child) { if (child == phy->dev.of_node) goto phy_found; } continue; } phy_found: class_dev_iter_exit(&iter); return phy; } Loading Loading @@ -562,12 +569,14 @@ EXPORT_SYMBOL_GPL(devm_of_phy_get); /** * phy_create() - create a new phy * @dev: device that is creating the new phy * @node: device node of the phy * @ops: function pointers for performing phy operations * @init_data: contains the list of PHY consumers or NULL * * Called to create a phy using phy framework. */ struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { int ret; Loading @@ -593,7 +602,7 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops, phy->dev.class = phy_class; phy->dev.parent = dev; phy->dev.of_node = dev->of_node; phy->dev.of_node = node ?: dev->of_node; phy->id = id; phy->ops = ops; phy->init_data = init_data; Loading Loading @@ -625,6 +634,7 @@ EXPORT_SYMBOL_GPL(phy_create); /** * devm_phy_create() - create a new phy * @dev: device that is creating the new phy * @node: device node of the phy * @ops: function pointers for performing phy operations * @init_data: contains the list of PHY consumers or NULL * Loading @@ -633,7 +643,8 @@ EXPORT_SYMBOL_GPL(phy_create); * On driver detach, release function is invoked on the devres data, * then, devres data is freed. */ struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { struct phy **ptr, *phy; Loading @@ -642,7 +653,7 @@ struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, if (!ptr) return ERR_PTR(-ENOMEM); phy = phy_create(dev, ops, init_data); phy = phy_create(dev, node, ops, init_data); if (!IS_ERR(phy)) { *ptr = phy; devres_add(dev, ptr); Loading drivers/phy/phy-msm-sata.c +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ static int msm_sata_phy_probe(struct platform_device *pdev) goto out; } generic_phy = devm_phy_create(dev, &msm_sata_phy_ops, NULL); generic_phy = devm_phy_create(dev, NULL, &msm_sata_phy_ops, NULL); if (IS_ERR(generic_phy)) { err = PTR_ERR(generic_phy); dev_err(dev, "%s: failed to create phy %d\n", __func__, err); Loading drivers/phy/phy-qcom-ufs.c +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, goto out; } generic_phy = devm_phy_create(dev, ufs_qcom_phy_gen_ops, NULL); generic_phy = devm_phy_create(dev, NULL, ufs_qcom_phy_gen_ops, NULL); if (IS_ERR(generic_phy)) { err = PTR_ERR(generic_phy); dev_err(dev, "%s: failed to create phy %d\n", __func__, err); Loading include/linux/phy/phy.h +10 −5 Original line number Diff line number Diff line Loading @@ -156,9 +156,10 @@ void devm_phy_put(struct device *dev, struct phy *phy); struct phy *of_phy_get(struct device_node *np, const char *con_id); struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args *args); struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); struct phy *devm_phy_create(struct device *dev, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); void phy_destroy(struct phy *phy); void devm_phy_destroy(struct device *dev, struct phy *phy); Loading Loading @@ -297,13 +298,17 @@ static inline struct phy *of_phy_simple_xlate(struct device *dev, } static inline struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy_init_data *init_data) struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { return ERR_PTR(-ENOSYS); } static inline struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy_init_data *init_data) struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { return ERR_PTR(-ENOSYS); } Loading Loading
Documentation/phy.txt +6 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ unregister the PHY. The PHY driver should create the PHY in order for other peripheral controllers to make use of it. The PHY framework provides 2 APIs to create the PHY. struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); The PHY drivers can use one of the above 2 APIs to create the PHY by passing Loading
drivers/phy/phy-core.c +18 −7 Original line number Diff line number Diff line Loading @@ -398,13 +398,20 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args struct phy *phy; struct class_dev_iter iter; struct device_node *node = dev->of_node; struct device_node *child; class_dev_iter_init(&iter, phy_class, NULL, NULL); while ((dev = class_dev_iter_next(&iter))) { phy = to_phy(dev); if (node != phy->dev.of_node) if (node != phy->dev.of_node) { for_each_child_of_node(node, child) { if (child == phy->dev.of_node) goto phy_found; } continue; } phy_found: class_dev_iter_exit(&iter); return phy; } Loading Loading @@ -562,12 +569,14 @@ EXPORT_SYMBOL_GPL(devm_of_phy_get); /** * phy_create() - create a new phy * @dev: device that is creating the new phy * @node: device node of the phy * @ops: function pointers for performing phy operations * @init_data: contains the list of PHY consumers or NULL * * Called to create a phy using phy framework. */ struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { int ret; Loading @@ -593,7 +602,7 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops, phy->dev.class = phy_class; phy->dev.parent = dev; phy->dev.of_node = dev->of_node; phy->dev.of_node = node ?: dev->of_node; phy->id = id; phy->ops = ops; phy->init_data = init_data; Loading Loading @@ -625,6 +634,7 @@ EXPORT_SYMBOL_GPL(phy_create); /** * devm_phy_create() - create a new phy * @dev: device that is creating the new phy * @node: device node of the phy * @ops: function pointers for performing phy operations * @init_data: contains the list of PHY consumers or NULL * Loading @@ -633,7 +643,8 @@ EXPORT_SYMBOL_GPL(phy_create); * On driver detach, release function is invoked on the devres data, * then, devres data is freed. */ struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { struct phy **ptr, *phy; Loading @@ -642,7 +653,7 @@ struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, if (!ptr) return ERR_PTR(-ENOMEM); phy = phy_create(dev, ops, init_data); phy = phy_create(dev, node, ops, init_data); if (!IS_ERR(phy)) { *ptr = phy; devres_add(dev, ptr); Loading
drivers/phy/phy-msm-sata.c +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ static int msm_sata_phy_probe(struct platform_device *pdev) goto out; } generic_phy = devm_phy_create(dev, &msm_sata_phy_ops, NULL); generic_phy = devm_phy_create(dev, NULL, &msm_sata_phy_ops, NULL); if (IS_ERR(generic_phy)) { err = PTR_ERR(generic_phy); dev_err(dev, "%s: failed to create phy %d\n", __func__, err); Loading
drivers/phy/phy-qcom-ufs.c +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, goto out; } generic_phy = devm_phy_create(dev, ufs_qcom_phy_gen_ops, NULL); generic_phy = devm_phy_create(dev, NULL, ufs_qcom_phy_gen_ops, NULL); if (IS_ERR(generic_phy)) { err = PTR_ERR(generic_phy); dev_err(dev, "%s: failed to create phy %d\n", __func__, err); Loading
include/linux/phy/phy.h +10 −5 Original line number Diff line number Diff line Loading @@ -156,9 +156,10 @@ void devm_phy_put(struct device *dev, struct phy *phy); struct phy *of_phy_get(struct device_node *np, const char *con_id); struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args *args); struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy *phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); struct phy *devm_phy_create(struct device *dev, struct phy *devm_phy_create(struct device *dev, struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data); void phy_destroy(struct phy *phy); void devm_phy_destroy(struct device *dev, struct phy *phy); Loading Loading @@ -297,13 +298,17 @@ static inline struct phy *of_phy_simple_xlate(struct device *dev, } static inline struct phy *phy_create(struct device *dev, const struct phy_ops *ops, struct phy_init_data *init_data) struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { return ERR_PTR(-ENOSYS); } static inline struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops, struct phy_init_data *init_data) struct device_node *node, const struct phy_ops *ops, struct phy_init_data *init_data) { return ERR_PTR(-ENOSYS); } Loading