On Fri, Jan 24, 2014 at 12:57 PM, Helmut Schaa
<[email protected]> wrote:
>
> Signed-off-by: Helmut Schaa <[email protected]>
> ---
> .../generic/files/drivers/net/phy/b53/b53_mdio.c | 44
> ++++++----------------
> 1 file changed, 12 insertions(+), 32 deletions(-)
>
> diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
> b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
> index 3c25f0e..b86ea1a 100644
> --- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
> +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
> @@ -341,8 +341,9 @@ static int b53_phy_read_status(struct phy_device *phydev)
> return 0;
> }
>
> -/* BCM5325, BCM539x */
> -static struct phy_driver b53_phy_driver_id1 = {
> +static struct phy_driver b53_phy_drivers[] = {
> +{
> + /* BCM5325, BCM539x */
> .phy_id = 0x0143bc00,
> .name = "Broadcom B53 (1)",
> .phy_id_mask = 0x1ffffc00,
> @@ -355,10 +356,8 @@ static struct phy_driver b53_phy_driver_id1 = {
> .driver = {
> .owner = THIS_MODULE,
> },
> -};
> -
> -/* BCM53125, BCM53128 */
> -static struct phy_driver b53_phy_driver_id2 = {
> +}, {
> + /* BCM53125, BCM53128 */
> .phy_id = 0x03625c00,
> .name = "Broadcom B53 (2)",
> .phy_id_mask = 0x1ffffc00,
> @@ -371,10 +370,8 @@ static struct phy_driver b53_phy_driver_id2 = {
> .driver = {
> .owner = THIS_MODULE,
> },
> -};
> -
> -/* BCM5365 */
> -static struct phy_driver b53_phy_driver_id3 = {
> +}, {
> + /* BCM5365 */
> .phy_id = 0x00406000,
> .name = "Broadcom B53 (3)",
> .phy_id_mask = 0x1ffffc00,
> @@ -387,35 +384,18 @@ static struct phy_driver b53_phy_driver_id3 = {
> .driver = {
> .owner = THIS_MODULE,
> },
> -};
> +} };
> +
>
> int __init b53_phy_driver_register(void)
> {
> - int ret;
> -
> - ret = phy_driver_register(&b53_phy_driver_id1);
> - if (ret)
> - return ret;
> -
> - ret = phy_driver_register(&b53_phy_driver_id2);
> - if (ret)
> - goto err1;
> -
> - ret = phy_driver_register(&b53_phy_driver_id3);
> - if (!ret)
> - return 0;
> -
> - phy_driver_unregister(&b53_phy_driver_id2);
> -err1:
> - phy_driver_unregister(&b53_phy_driver_id1);
> - return ret;
> + return phy_drivers_register(b53_phy_drivers,
> + ARRAY_SIZE(b53_phy_drivers));
> }
>
> void __exit b53_phy_driver_unregister(void)
> {
> - phy_driver_unregister(&b53_phy_driver_id3);
> - phy_driver_unregister(&b53_phy_driver_id2);
> - phy_driver_unregister(&b53_phy_driver_id1);
> + phy_drivers_unregister(b53_phy_drivers, ARRAY_SIZE(b53_phy_drivers));
AFAICT phy_drivers_{un,}register is only available in 3.6+, so I would
like to hold this off until all targets are in appropriate version to
not risk breaking the "older" targets.
Jonas
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel