From: Paolo Abeni <pabeni@redhat.com>
To: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] microchip: lan865x: add ndo_eth_ioctl handler to enable PHY ioctl support
Date: Thu, 28 Aug 2025 09:24:17 +0200 [thread overview]
Message-ID: <646c6431-274f-4923-ab9d-bf0116645745@redhat.com> (raw)
In-Reply-To: <20250822085014.28281-1-parthiban.veerasooran@microchip.com>
On 8/22/25 10:50 AM, Parthiban Veerasooran wrote:
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index 84c41f193561..7f586f9558ff 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -320,12 +320,22 @@ static int lan865x_net_open(struct net_device *netdev)
> return 0;
> }
>
> +static int lan865x_eth_ioctl(struct net_device *netdev, struct ifreq *rq,
> + int cmd)
> +{
> + if (!netif_running(netdev))
> + return -EINVAL;
> +
> + return phy_mii_ioctl(netdev->phydev, rq, cmd);
> +}
> +
> static const struct net_device_ops lan865x_netdev_ops = {
> .ndo_open = lan865x_net_open,
> .ndo_stop = lan865x_net_close,
> .ndo_start_xmit = lan865x_send_packet,
> .ndo_set_rx_mode = lan865x_set_multicast_list,
> .ndo_set_mac_address = lan865x_set_mac_address,
> + .ndo_eth_ioctl = lan865x_eth_ioctl,
It looks like you could use directly phy_do_ioctl_running() and avoid
some code duplication.
/P
next prev parent reply other threads:[~2025-08-28 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 8:50 [PATCH net-next] microchip: lan865x: add ndo_eth_ioctl handler to enable PHY ioctl support Parthiban Veerasooran
2025-08-28 7:24 ` Paolo Abeni [this message]
2025-08-28 8:30 ` Parthiban.Veerasooran
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=646c6431-274f-4923-ab9d-bf0116645745@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=parthiban.veerasooran@microchip.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).