All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Chukun Pan <amadeus@jmu.edu.cn>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Yixun Lan <dlan@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	spacemit@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: spacemit: display phy driver information
Date: Thu, 22 Jan 2026 15:12:36 +0000	[thread overview]
Message-ID: <aXI-ZMbwXHBX4XiT@pie> (raw)
In-Reply-To: <20260122080001.73921-1-amadeus@jmu.edu.cn>

On Thu, Jan 22, 2026 at 04:00:01PM +0800, Chukun Pan wrote:
> Print the PHY driver used and interrupt status after connection.
> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  drivers/net/ethernet/spacemit/k1_emac.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/spacemit/k1_emac.c b/drivers/net/ethernet/spacemit/k1_emac.c
> index c85dc742c404..afb5b6a61c2c 100644
> --- a/drivers/net/ethernet/spacemit/k1_emac.c
> +++ b/drivers/net/ethernet/spacemit/k1_emac.c
> @@ -1568,6 +1568,7 @@ static int emac_phy_connect(struct net_device *ndev)
>  	struct device *dev = &priv->pdev->dev;
>  	struct phy_device *phydev;
>  	struct device_node *np;
> +	char *irq_str;
>  	int ret;
>  
>  	ret = of_get_phy_mode(dev->of_node, &priv->phy_interface);
> @@ -1610,6 +1611,11 @@ static int emac_phy_connect(struct net_device *ndev)
>  		goto err_node_put;
>  	}
>  
> +	irq_str = phy_attached_info_irq(phydev);
> +	netdev_info(ndev, "PHY driver [%s] (irq=%s)\n",
> +		    phydev->drv->name, irq_str);
> +	kfree(irq_str);

Would phy_attached_print() simplify the code?

Regards,
Yao Zi

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Yao Zi <me@ziyao.cc>
To: Chukun Pan <amadeus@jmu.edu.cn>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Yixun Lan <dlan@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	spacemit@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: spacemit: display phy driver information
Date: Thu, 22 Jan 2026 15:12:36 +0000	[thread overview]
Message-ID: <aXI-ZMbwXHBX4XiT@pie> (raw)
In-Reply-To: <20260122080001.73921-1-amadeus@jmu.edu.cn>

On Thu, Jan 22, 2026 at 04:00:01PM +0800, Chukun Pan wrote:
> Print the PHY driver used and interrupt status after connection.
> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  drivers/net/ethernet/spacemit/k1_emac.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/spacemit/k1_emac.c b/drivers/net/ethernet/spacemit/k1_emac.c
> index c85dc742c404..afb5b6a61c2c 100644
> --- a/drivers/net/ethernet/spacemit/k1_emac.c
> +++ b/drivers/net/ethernet/spacemit/k1_emac.c
> @@ -1568,6 +1568,7 @@ static int emac_phy_connect(struct net_device *ndev)
>  	struct device *dev = &priv->pdev->dev;
>  	struct phy_device *phydev;
>  	struct device_node *np;
> +	char *irq_str;
>  	int ret;
>  
>  	ret = of_get_phy_mode(dev->of_node, &priv->phy_interface);
> @@ -1610,6 +1611,11 @@ static int emac_phy_connect(struct net_device *ndev)
>  		goto err_node_put;
>  	}
>  
> +	irq_str = phy_attached_info_irq(phydev);
> +	netdev_info(ndev, "PHY driver [%s] (irq=%s)\n",
> +		    phydev->drv->name, irq_str);
> +	kfree(irq_str);

Would phy_attached_print() simplify the code?

Regards,
Yao Zi

  parent reply	other threads:[~2026-01-22 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22  8:00 [PATCH 1/1] net: spacemit: display phy driver information Chukun Pan
2026-01-22  8:00 ` Chukun Pan
2026-01-22 13:17 ` Andrew Lunn
2026-01-22 13:17   ` Andrew Lunn
2026-01-22 15:06   ` Chukun Pan
2026-01-22 15:06     ` Chukun Pan
2026-01-22 15:18     ` Andrew Lunn
2026-01-22 15:18       ` Andrew Lunn
2026-01-23  2:10       ` Vivian Wang
2026-01-23  2:10         ` Vivian Wang
2026-01-22 15:12 ` Yao Zi [this message]
2026-01-22 15:12   ` Yao Zi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aXI-ZMbwXHBX4XiT@pie \
    --to=me@ziyao.cc \
    --cc=amadeus@jmu.edu.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dlan@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=spacemit@lists.linux.dev \
    --cc=wangruikang@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.