All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] net: macb: add error handling on probe and
@ 2017-11-08  8:56 Michael Grzeschik
  2017-11-08  8:56 ` [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths Michael Grzeschik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Grzeschik @ 2017-11-08  8:56 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, kernel, andrew

This series adds more error handling to the macb driver.

Michael Grzeschik (2):
  net: macb: add of_phy_deregister_fixed_link to error paths
  net: macb: add of_node_put to error paths

 drivers/net/ethernet/cadence/macb_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths
  2017-11-08  8:56 [PATCH v2 0/2] net: macb: add error handling on probe and Michael Grzeschik
@ 2017-11-08  8:56 ` Michael Grzeschik
  2017-11-08  9:26   ` Nicolas Ferre
  2017-11-08  8:56 ` [PATCH v2 2/2] net: macb: add of_node_put " Michael Grzeschik
  2017-11-11  6:28 ` [PATCH v2 0/2] net: macb: add error handling on probe and David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2017-11-08  8:56 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, kernel, andrew

We add the call of_phy_deregister_fixed_link to all associated
error paths for memory clean up.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v2: removed extra parenthesis

drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 6df2cad61647a..b7846d6e9234e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -611,6 +611,8 @@ static int macb_mii_init(struct macb *bp)
 err_out_unregister_bus:
 	mdiobus_unregister(bp->mii_bus);
 err_out_free_mdiobus:
+	if (np && of_phy_is_fixed_link(np))
+		of_phy_deregister_fixed_link(np);
 	mdiobus_free(bp->mii_bus);
 err_out:
 	return err;
@@ -3552,6 +3554,8 @@ static int macb_probe(struct platform_device *pdev)
 err_out_unregister_mdio:
 	phy_disconnect(dev->phydev);
 	mdiobus_unregister(bp->mii_bus);
+	if (np && of_phy_is_fixed_link(np))
+		of_phy_deregister_fixed_link(np);
 	mdiobus_free(bp->mii_bus);
 
 	/* Shutdown the PHY if there is a GPIO reset */
@@ -3574,6 +3578,7 @@ static int macb_remove(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct macb *bp;
+	struct device_node *np = pdev->dev.of_node;
 
 	dev = platform_get_drvdata(pdev);
 
@@ -3582,6 +3587,8 @@ static int macb_remove(struct platform_device *pdev)
 		if (dev->phydev)
 			phy_disconnect(dev->phydev);
 		mdiobus_unregister(bp->mii_bus);
+		if (np && of_phy_is_fixed_link(np))
+			of_phy_deregister_fixed_link(np);
 		dev->phydev = NULL;
 		mdiobus_free(bp->mii_bus);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] net: macb: add of_node_put to error paths
  2017-11-08  8:56 [PATCH v2 0/2] net: macb: add error handling on probe and Michael Grzeschik
  2017-11-08  8:56 ` [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths Michael Grzeschik
@ 2017-11-08  8:56 ` Michael Grzeschik
  2017-11-08  9:26   ` Nicolas Ferre
  2017-11-11  6:28 ` [PATCH v2 0/2] net: macb: add error handling on probe and David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2017-11-08  8:56 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, kernel, andrew

We add the call of_node_put(bp->phy_node) to all associated error
paths for memory clean up.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v2: removed extra of_node_put from macb_remove

 drivers/net/ethernet/cadence/macb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index b7846d6e9234e..0f24ca5a24b53 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -611,6 +611,7 @@ static int macb_mii_init(struct macb *bp)
 err_out_unregister_bus:
 	mdiobus_unregister(bp->mii_bus);
 err_out_free_mdiobus:
+	of_node_put(bp->phy_node);
 	if (np && of_phy_is_fixed_link(np))
 		of_phy_deregister_fixed_link(np);
 	mdiobus_free(bp->mii_bus);
@@ -3554,6 +3555,7 @@ static int macb_probe(struct platform_device *pdev)
 err_out_unregister_mdio:
 	phy_disconnect(dev->phydev);
 	mdiobus_unregister(bp->mii_bus);
+	of_node_put(bp->phy_node);
 	if (np && of_phy_is_fixed_link(np))
 		of_phy_deregister_fixed_link(np);
 	mdiobus_free(bp->mii_bus);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths
  2017-11-08  8:56 ` [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths Michael Grzeschik
@ 2017-11-08  9:26   ` Nicolas Ferre
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2017-11-08  9:26 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: netdev, kernel, andrew

On 08/11/2017 at 09:56, Michael Grzeschik wrote:
> We add the call of_phy_deregister_fixed_link to all associated
> error paths for memory clean up.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> v2: removed extra parenthesis
> 
> drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 6df2cad61647a..b7846d6e9234e 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -611,6 +611,8 @@ static int macb_mii_init(struct macb *bp)
>  err_out_unregister_bus:
>  	mdiobus_unregister(bp->mii_bus);
>  err_out_free_mdiobus:
> +	if (np && of_phy_is_fixed_link(np))
> +		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
>  err_out:
>  	return err;
> @@ -3552,6 +3554,8 @@ static int macb_probe(struct platform_device *pdev)
>  err_out_unregister_mdio:
>  	phy_disconnect(dev->phydev);
>  	mdiobus_unregister(bp->mii_bus);
> +	if (np && of_phy_is_fixed_link(np))
> +		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
>  
>  	/* Shutdown the PHY if there is a GPIO reset */
> @@ -3574,6 +3578,7 @@ static int macb_remove(struct platform_device *pdev)
>  {
>  	struct net_device *dev;
>  	struct macb *bp;
> +	struct device_node *np = pdev->dev.of_node;
>  
>  	dev = platform_get_drvdata(pdev);
>  
> @@ -3582,6 +3587,8 @@ static int macb_remove(struct platform_device *pdev)
>  		if (dev->phydev)
>  			phy_disconnect(dev->phydev);
>  		mdiobus_unregister(bp->mii_bus);
> +		if (np && of_phy_is_fixed_link(np))
> +			of_phy_deregister_fixed_link(np);
>  		dev->phydev = NULL;
>  		mdiobus_free(bp->mii_bus);
>  
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] net: macb: add of_node_put to error paths
  2017-11-08  8:56 ` [PATCH v2 2/2] net: macb: add of_node_put " Michael Grzeschik
@ 2017-11-08  9:26   ` Nicolas Ferre
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2017-11-08  9:26 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: netdev, kernel, andrew

On 08/11/2017 at 09:56, Michael Grzeschik wrote:
> We add the call of_node_put(bp->phy_node) to all associated error
> paths for memory clean up.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> v2: removed extra of_node_put from macb_remove
> 
>  drivers/net/ethernet/cadence/macb_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index b7846d6e9234e..0f24ca5a24b53 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -611,6 +611,7 @@ static int macb_mii_init(struct macb *bp)
>  err_out_unregister_bus:
>  	mdiobus_unregister(bp->mii_bus);
>  err_out_free_mdiobus:
> +	of_node_put(bp->phy_node);
>  	if (np && of_phy_is_fixed_link(np))
>  		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
> @@ -3554,6 +3555,7 @@ static int macb_probe(struct platform_device *pdev)
>  err_out_unregister_mdio:
>  	phy_disconnect(dev->phydev);
>  	mdiobus_unregister(bp->mii_bus);
> +	of_node_put(bp->phy_node);
>  	if (np && of_phy_is_fixed_link(np))
>  		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] net: macb: add error handling on probe and
  2017-11-08  8:56 [PATCH v2 0/2] net: macb: add error handling on probe and Michael Grzeschik
  2017-11-08  8:56 ` [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths Michael Grzeschik
  2017-11-08  8:56 ` [PATCH v2 2/2] net: macb: add of_node_put " Michael Grzeschik
@ 2017-11-11  6:28 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-11-11  6:28 UTC (permalink / raw)
  To: m.grzeschik; +Cc: nicolas.ferre, netdev, kernel, andrew

From: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date: Wed,  8 Nov 2017 09:56:33 +0100

> This series adds more error handling to the macb driver.

Series applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-11  6:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  8:56 [PATCH v2 0/2] net: macb: add error handling on probe and Michael Grzeschik
2017-11-08  8:56 ` [PATCH v2 1/2] net: macb: add of_phy_deregister_fixed_link to error paths Michael Grzeschik
2017-11-08  9:26   ` Nicolas Ferre
2017-11-08  8:56 ` [PATCH v2 2/2] net: macb: add of_node_put " Michael Grzeschik
2017-11-08  9:26   ` Nicolas Ferre
2017-11-11  6:28 ` [PATCH v2 0/2] net: macb: add error handling on probe and David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.