All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: altera_tse: fix connect_local_phy error path
@ 2019-01-21  8:26 Atsushi Nemoto
  2019-01-22 17:15 ` Thor Thayer
  2019-01-23  1:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Atsushi Nemoto @ 2019-01-21  8:26 UTC (permalink / raw)
  To: Thor Thayer, netdev

The connect_local_phy should return NULL (not negative errno) on
error, since its caller expects it.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
---
 drivers/net/ethernet/altera/altera_tse_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 02921d8..aa1d1f5 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev)
 
 		phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
 				     priv->phy_iface);
-		if (IS_ERR(phydev))
+		if (IS_ERR(phydev)) {
 			netdev_err(dev, "Could not attach to PHY\n");
+			phydev = NULL;
+		}
 
 	} else {
 		int ret;
-- 
2.1.4



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

* Re: [PATCH] net: altera_tse: fix connect_local_phy error path
  2019-01-21  8:26 [PATCH] net: altera_tse: fix connect_local_phy error path Atsushi Nemoto
@ 2019-01-22 17:15 ` Thor Thayer
  2019-01-23  1:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Thor Thayer @ 2019-01-22 17:15 UTC (permalink / raw)
  To: Atsushi Nemoto, netdev; +Cc: Dalon Westergreen

On 1/21/19 2:26 AM, Atsushi Nemoto wrote:
> The connect_local_phy should return NULL (not negative errno) on
> error, since its caller expects it.
> 
> Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
> ---
>   drivers/net/ethernet/altera/altera_tse_main.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
> index 02921d8..aa1d1f5 100644
> --- a/drivers/net/ethernet/altera/altera_tse_main.c
> +++ b/drivers/net/ethernet/altera/altera_tse_main.c
> @@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev)
>   
>   		phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
>   				     priv->phy_iface);
> -		if (IS_ERR(phydev))
> +		if (IS_ERR(phydev)) {
>   			netdev_err(dev, "Could not attach to PHY\n");
> +			phydev = NULL;
> +		}
>   
>   	} else {
>   		int ret;
> 

Thanks for the patch!

Acked-by: Thor Thayer <thor.thayer@linux.intel.com>

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

* Re: [PATCH] net: altera_tse: fix connect_local_phy error path
  2019-01-21  8:26 [PATCH] net: altera_tse: fix connect_local_phy error path Atsushi Nemoto
  2019-01-22 17:15 ` Thor Thayer
@ 2019-01-23  1:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-01-23  1:46 UTC (permalink / raw)
  To: atsushi.nemoto; +Cc: thor.thayer, netdev

From: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
Date: Mon, 21 Jan 2019 17:26:41 +0900

> The connect_local_phy should return NULL (not negative errno) on
> error, since its caller expects it.
> 
> Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>

Applied.

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

end of thread, other threads:[~2019-01-23  1:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21  8:26 [PATCH] net: altera_tse: fix connect_local_phy error path Atsushi Nemoto
2019-01-22 17:15 ` Thor Thayer
2019-01-23  1:46 ` 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.