Message ID | 20210611105401.270673-5-ciorneiioana@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2d7b8bf1fa7afab77f106b67ec6e3d524e3745ca |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ACPI support for dpaa2 driver | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 6 of 6 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 19 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
On Fri, Jun 11, 2021 at 1:54 PM Ioana Ciornei <ciorneiioana@gmail.com> wrote: > > From: Calvin Johnson <calvin.johnson@oss.nxp.com> > > Refactor of_phy_find_device() to use fwnode_phy_find_device(). I see that there are many users of this, but I think eventually we should kill of_phy_find_device() completely.
On Fri, Jun 11, 2021 at 2:28 PM Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Fri, Jun 11, 2021 at 1:54 PM Ioana Ciornei <ciorneiioana@gmail.com> wrote: > > > > From: Calvin Johnson <calvin.johnson@oss.nxp.com> > > > > Refactor of_phy_find_device() to use fwnode_phy_find_device(). > > I see that there are many users of this, but I think eventually we > should kill of_phy_find_device() completely. Looking into other examples of such I think this series may not touch them right now, but clearly state that it's the plan in the future to kill this kind of OF APIs that call fwnode underneath.
On Fri, Jun 11, 2021 at 02:30:19PM +0300, Andy Shevchenko wrote: > On Fri, Jun 11, 2021 at 2:28 PM Andy Shevchenko > <andy.shevchenko@gmail.com> wrote: > > On Fri, Jun 11, 2021 at 1:54 PM Ioana Ciornei <ciorneiioana@gmail.com> wrote: > > > > > > From: Calvin Johnson <calvin.johnson@oss.nxp.com> > > > > > > Refactor of_phy_find_device() to use fwnode_phy_find_device(). > > > > I see that there are many users of this, but I think eventually we > > should kill of_phy_find_device() completely. > > Looking into other examples of such I think this series may not touch > them right now, but clearly state that it's the plan in the future to > kill this kind of OF APIs that call fwnode underneath. That's something I most definitely support - once we have the fwnode APIs in place, the OF specific APIs become an additional maintenance burden that we don't need. So, I would also like to see the old APIs killed.
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c index 6ef8b6e40189..0ba1158796d9 100644 --- a/drivers/net/mdio/of_mdio.c +++ b/drivers/net/mdio/of_mdio.c @@ -360,18 +360,7 @@ EXPORT_SYMBOL(of_mdio_find_device); */ struct phy_device *of_phy_find_device(struct device_node *phy_np) { - struct mdio_device *mdiodev; - - mdiodev = of_mdio_find_device(phy_np); - if (!mdiodev) - return NULL; - - if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY) - return to_phy_device(&mdiodev->dev); - - put_device(&mdiodev->dev); - - return NULL; + return fwnode_phy_find_device(of_fwnode_handle(phy_np)); } EXPORT_SYMBOL(of_phy_find_device);