[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1391511050.3003.21.camel@deadeye.wl.decadent.org.uk>
Date: Tue, 04 Feb 2014 10:50:50 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Stefan Sørensen
<stefan.sorensen@...ctralink.com>
Cc: mugunthanvnm@...com, davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] net:cpsw: Pass unhandled ioctl's on to generic phy ioctl
On Tue, 2014-02-04 at 08:50 +0100, Stefan Sørensen wrote:
> This patch allows the use of a generic timestamping phy connected
> to the cpsw if CPTS support is not enabled.
What if CPTS support is enabled in the driver, but this particular
machine doesn't have it and uses a timestamping PHY instead?
> Signed-off-by: Stefan Sørensen <stefan.sorensen@...ctralink.com>
> ---
> drivers/net/ethernet/ti/cpsw.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index bde63e3..a03cfb3 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1486,12 +1486,12 @@ static int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
> #endif
> case SIOCGMIIPHY:
> data->phy_id = priv->slaves[slave_no].phy->addr;
It looks like this existing code is broken, as the phy pointer can be
NULL!
> - break;
> - default:
> - return -ENOTSUPP;
> + return 0;
> }
>
> - return 0;
> + if (!priv->slaves[slave_no].phy)
> + return -EINVAL;
> + return phy_mii_ioctl(priv->slaves[slave_no].phy, req, cmd);
This presumably also enables SIOC{G,S}MIIREG, but you didn't mention
that.
Ben.
> }
>
> static void cpsw_ndo_tx_timeout(struct net_device *ndev)
--
Ben Hutchings
One of the nice things about standards is that there are so many of them.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists