diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2009-11-16 12:57:47 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-17 03:54:01 -0800 |
commit | 59179ea60c117fe62b80705a12c1e9e919638120 (patch) | |
tree | 759911e34f85409de8451376fd8394a63a3b84b3 | |
parent | 377a1f0b92819697aa1792f171c305a681fcca5a (diff) |
net/can/mscan: use {clr|set}bits8 macros
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/can/mscan/mscan.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c index 839b471cdf5..ca8b55685ad 100644 --- a/drivers/net/can/mscan/mscan.c +++ b/drivers/net/can/mscan/mscan.c @@ -78,8 +78,7 @@ static int mscan_set_mode(struct net_device *dev, u8 mode) canctl1 = in_8(®s->canctl1); if ((mode & MSCAN_SLPRQ) && !(canctl1 & MSCAN_SLPAK)) { - out_8(®s->canctl0, - in_8(®s->canctl0) | MSCAN_SLPRQ); + setbits8(®s->canctl0, MSCAN_SLPRQ); for (i = 0; i < MSCAN_SET_MODE_RETRIES; i++) { if (in_8(®s->canctl1) & MSCAN_SLPAK) break; @@ -105,8 +104,7 @@ static int mscan_set_mode(struct net_device *dev, u8 mode) } if ((mode & MSCAN_INITRQ) && !(canctl1 & MSCAN_INITAK)) { - out_8(®s->canctl0, - in_8(®s->canctl0) | MSCAN_INITRQ); + setbits8(®s->canctl0, MSCAN_INITRQ); for (i = 0; i < MSCAN_SET_MODE_RETRIES; i++) { if (in_8(®s->canctl1) & MSCAN_INITAK) break; @@ -118,14 +116,12 @@ static int mscan_set_mode(struct net_device *dev, u8 mode) priv->can.state = CAN_STATE_STOPPED; if (mode & MSCAN_CSWAI) - out_8(®s->canctl0, - in_8(®s->canctl0) | MSCAN_CSWAI); + setbits8(®s->canctl0, MSCAN_CSWAI); } else { canctl1 = in_8(®s->canctl1); if (canctl1 & (MSCAN_SLPAK | MSCAN_INITAK)) { - out_8(®s->canctl0, in_8(®s->canctl0) & - ~(MSCAN_SLPRQ | MSCAN_INITRQ)); + clrbits8(®s->canctl0, MSCAN_SLPRQ | MSCAN_INITRQ); for (i = 0; i < MSCAN_SET_MODE_RETRIES; i++) { canctl1 = in_8(®s->canctl1); if (!(canctl1 & (MSCAN_INITAK | MSCAN_SLPAK))) @@ -359,8 +355,7 @@ static void mscan_get_err_frame(struct net_device *dev, struct can_frame *frame, */ out_8(®s->cantier, 0); out_8(®s->canrier, 0); - out_8(®s->canctl0, in_8(®s->canctl0) | - MSCAN_SLPRQ | MSCAN_INITRQ); + setbits8(®s->canctl0, MSCAN_SLPRQ | MSCAN_INITRQ); can_bus_off(dev); break; default: @@ -548,7 +543,7 @@ static int mscan_open(struct net_device *dev) priv->open_time = jiffies; - out_8(®s->canctl1, in_8(®s->canctl1) & ~MSCAN_LISTEN); + clrbits8(®s->canctl1, MSCAN_LISTEN); ret = mscan_start(dev); if (ret) @@ -623,7 +618,7 @@ void unregister_mscandev(struct net_device *dev) struct mscan_priv *priv = netdev_priv(dev); struct mscan_regs *regs = (struct mscan_regs *)priv->reg_base; mscan_set_mode(dev, MSCAN_INIT_MODE); - out_8(®s->canctl1, in_8(®s->canctl1) & ~MSCAN_CANE); + clrbits8(®s->canctl1, MSCAN_CANE); unregister_candev(dev); } EXPORT_SYMBOL_GPL(unregister_mscandev); |