Skip to content

Commit

Permalink
ravb: make ravb_ptp_interrupt() *void*
Browse files Browse the repository at this point in the history
When we have the ISS.CGIS bit set, we already know that gPTP interrupt has
happened, so an extra GIS register check at the end of ravb_ptp_interrupt()
seems superfluous.  We can model the gPTP interrupt  handler like all other
dedicated interrupt handlers in the driver and make it *void*.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Apr 14, 2016
1 parent b9aa78d commit d0988a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/renesas/ravb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ void ravb_modify(struct net_device *ndev, enum ravb_reg reg, u32 clear,
u32 set);
int ravb_wait(struct net_device *ndev, enum ravb_reg reg, u32 mask, u32 value);

irqreturn_t ravb_ptp_interrupt(struct net_device *ndev);
void ravb_ptp_interrupt(struct net_device *ndev);
void ravb_ptp_init(struct net_device *ndev, struct platform_device *pdev);
void ravb_ptp_stop(struct net_device *ndev);

Expand Down
8 changes: 6 additions & 2 deletions drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,10 @@ static irqreturn_t ravb_interrupt(int irq, void *dev_id)
}

/* gPTP interrupt status summary */
if ((iss & ISS_CGIS) && ravb_ptp_interrupt(ndev) == IRQ_HANDLED)
if (iss & ISS_CGIS) {
ravb_ptp_interrupt(ndev);
result = IRQ_HANDLED;
}

mmiowb();
spin_unlock(&priv->lock);
Expand Down Expand Up @@ -838,8 +840,10 @@ static irqreturn_t ravb_multi_interrupt(int irq, void *dev_id)
}

/* gPTP interrupt status summary */
if ((iss & ISS_CGIS) && ravb_ptp_interrupt(ndev) == IRQ_HANDLED)
if (iss & ISS_CGIS) {
ravb_ptp_interrupt(ndev);
result = IRQ_HANDLED;
}

mmiowb();
spin_unlock(&priv->lock);
Expand Down
9 changes: 2 additions & 7 deletions drivers/net/ethernet/renesas/ravb_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static const struct ptp_clock_info ravb_ptp_info = {
};

/* Caller must hold the lock */
irqreturn_t ravb_ptp_interrupt(struct net_device *ndev)
void ravb_ptp_interrupt(struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
u32 gis = ravb_read(ndev, GIS);
Expand All @@ -319,12 +319,7 @@ irqreturn_t ravb_ptp_interrupt(struct net_device *ndev)
}
}

if (gis) {
ravb_write(ndev, ~gis, GIS);
return IRQ_HANDLED;
}

return IRQ_NONE;
ravb_write(ndev, ~gis, GIS);
}

void ravb_ptp_init(struct net_device *ndev, struct platform_device *pdev)
Expand Down

0 comments on commit d0988a5

Please sign in to comment.