netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Michael Walle <michael@walle.cc>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] enetc: add ioctl() support for PHY-related ops
Date: Thu, 7 Nov 2019 16:25:32 +0100	[thread overview]
Message-ID: <20191107152532.GD7344@lunn.ch> (raw)
In-Reply-To: <20191107083937.18228-1-michael@walle.cc>

On Thu, Nov 07, 2019 at 09:39:37AM +0100, Michael Walle wrote:
> If there is an attached PHY try to handle the requested ioctl with its
> handler, which allows the userspace to access PHY registers, for
> example. This will make mii-diag and similar tools work.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  drivers/net/ethernet/freescale/enetc/enetc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index b6ff89307409..25af207f1962 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1599,7 +1599,10 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
>  	if (cmd == SIOCGHWTSTAMP)
>  		return enetc_hwtstamp_get(ndev, rq);
>  #endif
> -	return -EINVAL;
> +
> +	if (!ndev->phydev)
> +		return -EINVAL;

Hi Michael

I think EOPNOTSUPP is normal. Yes, you are just moving around what was
there before, but you could make this improvement as well.

If you don't want to:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2019-11-07 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  8:39 [PATCH] enetc: add ioctl() support for PHY-related ops Michael Walle
2019-11-07 15:25 ` Andrew Lunn [this message]
2019-11-07 23:25 ` David Miller

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=20191107152532.GD7344@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    /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).