]> git.ipfire.org Git - thirdparty/linux.git/commit
usb: phy: generic: Convert to devm_clk_get_optional()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 21 Jan 2026 14:11:21 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 16:16:54 +0000 (17:16 +0100)
commit300034f97b04761c57111e899eb9d7ce08fcdcd1
treefb5500280f144f5344af9d7218d80b58ae939dcf
parent62b718d23348b675411b6858931932bf4541fc4b
usb: phy: generic: Convert to devm_clk_get_optional()

The generic USB PHY driver uses the existence of the "clocks" property
to see if a clock is optional or not.  Use devm_clk_get_optional()
instead, which exists for this purpose.  As usb_phy_generic.clk is now
either a valid clock pointer or NULL, and all clock operations handle
NULL pointers gracefully, several IS_ERR() checks can be removed,
simplifying the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
...

Link: https://patch.msgid.link/5cc21d821edf5d40f56a74cd251bb1b982876b72.1769004444.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/phy/phy-generic.c