Skip to content

phy: Add devm_of_phy_optional_get() helper

Geert Uytterhoeven linux-arm-kernel linux-doc linux-pci linux-phy linux-samsung-soc linux-tegra linux-usb netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 8 repliesIn review
  2. v17 patches 15 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9phy: Remove unused phy_optional_get()Documentation/driver-api/phy/phy.rst drivers/phy/phy-core.c include/linux/phy/phy.h+5 -340 replies
2/9doc: phy: Document devm_of_phy_get()Documentation/driver-api/phy/phy.rst+6 -40 replies
3/9phy: Add devm_of_phy_optional_get() helperDocumentation/driver-api/phy/phy.rst drivers/phy/phy-core.c include/linux/phy/phy.h+44 -20 replies
4/9net: fman: memac: Convert to devm_of_phy_optional_get()drivers/net/ethernet/freescale/fman/fman_memac.c+4 -50 replies
5/9net: lan966x: Convert to devm_of_phy_optional_get()drivers/net/ethernet/microchip/lan966x/lan966x_main.c+2 -30 replies
6/9net: ethernet: ti: am65-cpsw: Convert to devm_of_phy_optional_get()drivers/net/ethernet/ti/am65-cpsw-nuss.c+3 -54 replies
7/9PCI: tegra: Convert to devm_of_phy_optional_get()drivers/pci/controller/pci-tegra.c+1 -40 replies
8/9usb: host: ehci-exynos: Convert to devm_of_phy_optional_get()drivers/usb/host/ehci-exynos.c+6 -171 reply
9/9usb: host: ohci-exynos: Convert to devm_of_phy_optional_get()drivers/usb/host/ohci-exynos.c+6 -171 reply

Reviews trailers per patch

6 of 9 patches have a Reviewed-by or Acked-by.

PatchAlan SternGreg Kroah-HartmanSean AndersonSteen HegelundBjorn HelgaasSiddharth Vadapalli
1/9
2/9
3/9
4/9R-b
5/9R-b
6/9R-b
7/9A-b
8/9R-b A-b
9/9A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v2 thread

Cover letter [PATCH treewide v2 0/9] phy: Add devm_of_phy_optional_get() helper

Hi Vinod et al,

While there exist several optional_get() PHY helper functions, there is no optional variant of devm_of_phy_get(), leading to several drivers implementing this theirselves, sometimes in buggy ways.

Hence this series, after two cleanup patches, introduces a devm_of_phy_optional_get() helper(), and converts existing users of devm_of_phy_get() where appropriate.

Changes compared to v1[1]:
- Incorporate "[PATCH v2 1/9] phy: Remove unused phy_optional_get()", as it touches the same documentation,
- New patch "[PATCH v2 2/9] doc: phy: Document devm_of_phy_get()",
- Print an error message in case of failure, as requested by RobH,
- Update Documentation,
- Clarify removed checks for -ENODEV and -ENOSYS,
- Remove error printing in case of real failures from callers,
- Rebase am65-cpsw change on top of commit 854617f52ab42418 ("net:
ethernet: ti: am65-cpsw: Handle -EPROBE_DEFER for Serdes PHY") in net-next (next-20230123 and later),
- Add Reviewed-by, Acked-by.

Most of this series been compile-tested only, but the new helper itself has been tested with a new user[2].

Thanks for your comments!

[1] "[PATCH treewide 0/7] phy: Add devm_of_phy_optional_get() helper"

    https://lore.kernel.org/r/[email protected]
[2] "[PATCH 12/12] can: rcar_canfd: Add transceiver support"
    https://lore.kernel.org/r/e825b50a843ffe40e33f34e4d858c07c1b2ff259.1674499048.git.geert+renesas@glider.be

Geert Uytterhoeven (9):
phy: Remove unused phy_optional_get()
doc: phy: Document devm_of_phy_get()
phy: Add devm_of_phy_optional_get() helper
net: fman: memac: Convert to devm_of_phy_optional_get()
net: lan966x: Convert to devm_of_phy_optional_get()
net: ethernet: ti: am65-cpsw: Convert to devm_of_phy_optional_get()
PCI: tegra: Convert to devm_of_phy_optional_get()
usb: host: ehci-exynos: Convert to devm_of_phy_optional_get()
usb: host: ohci-exynos: Convert to devm_of_phy_optional_get()

 Documentation/driver-api/phy/phy.rst          | 24 +++++----
 .../net/ethernet/freescale/fman/fman_memac.c  |  9 ++--
 .../ethernet/microchip/lan966x/lan966x_main.c |  5 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c      |  8 ++-
 drivers/pci/controller/pci-tegra.c            |  5 +-
 drivers/phy/phy-core.c                        | 51 +++++++++++--------
 drivers/usb/host/ehci-exynos.c                | 23 +++------
 drivers/usb/host/ohci-exynos.c                | 23 +++------
 include/linux/phy/phy.h                       | 16 +++---
 9 files changed, 75 insertions(+), 89 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds