]> git.baikalelectronics.ru Git - uboot.git/commit
net: phy: Make phy_interface_is_rgmii a switch statement
authorNishanth Menon <nm@ti.com>
Fri, 14 Apr 2023 22:06:45 +0000 (17:06 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 5 May 2023 21:48:44 +0000 (17:48 -0400)
commitd68f66544b4fdd9e7914c010f0f048660ac062d7
tree373d329312ff9f0ae57c04fbe594818c74297a5d
parent18593e7d13a084f67e7148a76bbe2695cf24deb9
net: phy: Make phy_interface_is_rgmii a switch statement

Recent commit 3499e32be935 ("net: phy: Synchronize PHY interface modes
with Linux") reordered the enum definitions. This exposed a problem
in range checking functions to identify the interface type. Though
this specific api wasn't impacted (all the RGMII definitions remained
within range), this experience should be used to never to have to face
this kind of challenge again.

While it is possible for the phy drivers to use the enums directly,
drivers such as dp83867, dp83869, marvell, micrel_ksz90x1 etc use this
api.

Reported-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
include/phy.h