Skip to content

Commit

Permalink
net: ethernet: cpsw: fix build warnings for CPSW when CPTS not selected
Browse files Browse the repository at this point in the history
CC      drivers/net/ethernet/ti/cpsw.o
drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_ndo_ioctl':
drivers/net/ethernet/ti/cpsw.c:881:20: warning: unused variable 'priv'

The build warning is generated when CPTS is not selected in Kernel Build.
Fixing by passing the net_device pointer to cpts IOCTL instead of passing priv

Signed-off-by: Mugunthan V N <[email protected]>
Acked-by: Richard Cochran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mugunthanvnm authored and davem330 committed Nov 28, 2012
1 parent 83a9d19 commit 3177bf6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,9 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
__raw_writel(ETH_P_1588, &priv->regs->ts_ltype);
}

static int cpsw_hwtstamp_ioctl(struct cpsw_priv *priv, struct ifreq *ifr)
static int cpsw_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
{
struct cpsw_priv *priv = netdev_priv(dev);
struct cpts *cpts = &priv->cpts;
struct hwtstamp_config cfg;

Expand Down Expand Up @@ -878,14 +879,12 @@ static int cpsw_hwtstamp_ioctl(struct cpsw_priv *priv, struct ifreq *ifr)

static int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
struct cpsw_priv *priv = netdev_priv(dev);

if (!netif_running(dev))
return -EINVAL;

#ifdef CONFIG_TI_CPTS
if (cmd == SIOCSHWTSTAMP)
return cpsw_hwtstamp_ioctl(priv, req);
return cpsw_hwtstamp_ioctl(dev, req);
#endif
return -ENOTSUPP;
}
Expand Down

0 comments on commit 3177bf6

Please sign in to comment.