diff mbox

net: phy: fixed: propagate fixed link values to struct

Message ID 1440600508-7531-1-git-send-email-madalin.bucur@freescale.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Madalin Bucur Aug. 26, 2015, 2:48 p.m. UTC
The fixed link values parsed from the device tree are stored in
the struct fixed_phy member status. The struct phy_device members
speed, duplex were not updated.

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
---
 drivers/net/phy/fixed_phy.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stas Sergeev Aug. 26, 2015, 2:57 p.m. UTC | #1
26.08.2015 17:48, Madalin Bucur пишет:
> The fixed link values parsed from the device tree are stored in
> the struct fixed_phy member status. The struct phy_device members
> speed, duplex were not updated.
> 
> Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
> ---
>  drivers/net/phy/fixed_phy.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index 479b93f..20731fc 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -292,6 +292,15 @@ struct phy_device *fixed_phy_register(unsigned int irq,
>  		return ERR_PTR(-EINVAL);
>  	}
>  
> +	/* propagate the fixed link values to struct phy_device */
> +	if (status->link) {
> +		phy->link = status->link;
Oh, I wonder if you want to initialize phy->link regardless,
outside of the "if (status->link)" block.
Other than that,

Acked-by: Stas Sergeev <stsp@users.sourceforge.net>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index 479b93f..20731fc 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -292,6 +292,15 @@  struct phy_device *fixed_phy_register(unsigned int irq,
 		return ERR_PTR(-EINVAL);
 	}
 
+	/* propagate the fixed link values to struct phy_device */
+	if (status->link) {
+		phy->link = status->link;
+		phy->speed = status->speed;
+		phy->duplex = status->duplex;
+		phy->pause = status->pause;
+		phy->asym_pause = status->asym_pause;
+	}
+
 	of_node_get(np);
 	phy->dev.of_node = np;