aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cpmac.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-08-08 06:09:39 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-17 05:32:55 -0400
commit559764d1996e6ae769feb07918687b0806f2d975 (patch)
tree903eeb02dbb6964f55fc19afebd10d6fd7513f2e /drivers/net/cpmac.c
parent264fd77a67f1a4fe102477d824014459c7ff61f3 (diff)
cpmac: fix all checkpatch errors and warnings
This patches fixes a couple of checkpatch warnings and errors: - lines over 80 columns - printk() instead of pr_cont() - assignments in tests (if ((foo == bar()))) Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r--drivers/net/cpmac.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index ac3985ceb5f7..8e142aaa05d4 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -38,7 +38,7 @@
38#include <linux/platform_device.h> 38#include <linux/platform_device.h>
39#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
40#include <linux/clk.h> 40#include <linux/clk.h>
41#include <asm/gpio.h> 41#include <linux/gpio.h>
42#include <asm/atomic.h> 42#include <asm/atomic.h>
43 43
44MODULE_AUTHOR("Eugene Konev <ejka@imfi.kspu.ru>"); 44MODULE_AUTHOR("Eugene Konev <ejka@imfi.kspu.ru>");
@@ -108,7 +108,7 @@ MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus");
108#define CPMAC_RX_INT_CLEAR 0x019c 108#define CPMAC_RX_INT_CLEAR 0x019c
109#define CPMAC_MAC_INT_ENABLE 0x01a8 109#define CPMAC_MAC_INT_ENABLE 0x01a8
110#define CPMAC_MAC_INT_CLEAR 0x01ac 110#define CPMAC_MAC_INT_CLEAR 0x01ac
111#define CPMAC_MAC_ADDR_LO(channel) (0x01b0 + (channel) * 4) 111#define CPMAC_MAC_ADDR_LO(channel) (0x01b0 + (channel) * 4)
112#define CPMAC_MAC_ADDR_MID 0x01d0 112#define CPMAC_MAC_ADDR_MID 0x01d0
113#define CPMAC_MAC_ADDR_HI 0x01d4 113#define CPMAC_MAC_ADDR_HI 0x01d4
114#define CPMAC_MAC_HASH_LO 0x01d8 114#define CPMAC_MAC_HASH_LO 0x01d8
@@ -227,7 +227,7 @@ static void cpmac_dump_regs(struct net_device *dev)
227 for (i = 0; i < CPMAC_REG_END; i += 4) { 227 for (i = 0; i < CPMAC_REG_END; i += 4) {
228 if (i % 16 == 0) { 228 if (i % 16 == 0) {
229 if (i) 229 if (i)
230 printk("\n"); 230 pr_cont("\n");
231 printk(KERN_DEBUG "%s: reg[%p]:", dev->name, 231 printk(KERN_DEBUG "%s: reg[%p]:", dev->name,
232 priv->regs + i); 232 priv->regs + i);
233 } 233 }
@@ -262,7 +262,7 @@ static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
262 for (i = 0; i < skb->len; i++) { 262 for (i = 0; i < skb->len; i++) {
263 if (i % 16 == 0) { 263 if (i % 16 == 0) {
264 if (i) 264 if (i)
265 printk("\n"); 265 pr_cont("\n");
266 printk(KERN_DEBUG "%s: data[%p]:", dev->name, 266 printk(KERN_DEBUG "%s: data[%p]:", dev->name,
267 skb->data + i); 267 skb->data + i);
268 } 268 }
@@ -873,7 +873,8 @@ static int cpmac_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
873 return -EINVAL; 873 return -EINVAL;
874} 874}
875 875
876static void cpmac_get_ringparam(struct net_device *dev, struct ethtool_ringparam* ring) 876static void cpmac_get_ringparam(struct net_device *dev,
877 struct ethtool_ringparam *ring)
877{ 878{
878 struct cpmac_priv *priv = netdev_priv(dev); 879 struct cpmac_priv *priv = netdev_priv(dev);
879 880
@@ -888,7 +889,8 @@ static void cpmac_get_ringparam(struct net_device *dev, struct ethtool_ringparam
888 ring->tx_pending = 1; 889 ring->tx_pending = 1;
889} 890}
890 891
891static int cpmac_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ring) 892static int cpmac_set_ringparam(struct net_device *dev,
893 struct ethtool_ringparam *ring)
892{ 894{
893 struct cpmac_priv *priv = netdev_priv(dev); 895 struct cpmac_priv *priv = netdev_priv(dev);
894 896
@@ -1012,8 +1014,8 @@ static int cpmac_open(struct net_device *dev)
1012 1014
1013 priv->rx_head->prev->hw_next = (u32)0; 1015 priv->rx_head->prev->hw_next = (u32)0;
1014 1016
1015 if ((res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED, 1017 res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED, dev->name, dev);
1016 dev->name, dev))) { 1018 if (res) {
1017 if (netif_msg_drv(priv)) 1019 if (netif_msg_drv(priv))
1018 printk(KERN_ERR "%s: failed to obtain irq\n", 1020 printk(KERN_ERR "%s: failed to obtain irq\n",
1019 dev->name); 1021 dev->name);
@@ -1133,7 +1135,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1133 } 1135 }
1134 1136
1135 if (phy_id == PHY_MAX_ADDR) { 1137 if (phy_id == PHY_MAX_ADDR) {
1136 dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n"); 1138 dev_err(&pdev->dev, "no PHY present, falling back "
1139 "to switch on MDIO bus 0\n");
1137 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1140 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
1138 phy_id = pdev->id; 1141 phy_id = pdev->id;
1139 } 1142 }
@@ -1169,7 +1172,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1169 priv->msg_enable = netif_msg_init(debug_level, 0xff); 1172 priv->msg_enable = netif_msg_init(debug_level, 0xff);
1170 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr)); 1173 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr));
1171 1174
1172 snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); 1175 snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT,
1176 mdio_bus_id, phy_id);
1173 1177
1174 priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0, 1178 priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
1175 PHY_INTERFACE_MODE_MII); 1179 PHY_INTERFACE_MODE_MII);
@@ -1182,7 +1186,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1182 goto fail; 1186 goto fail;
1183 } 1187 }
1184 1188
1185 if ((rc = register_netdev(dev))) { 1189 rc = register_netdev(dev);
1190 if (rc) {
1186 printk(KERN_ERR "cpmac: error %i registering device %s\n", rc, 1191 printk(KERN_ERR "cpmac: error %i registering device %s\n", rc,
1187 dev->name); 1192 dev->name);
1188 goto fail; 1193 goto fail;
@@ -1248,11 +1253,13 @@ int __devinit cpmac_init(void)
1248 1253
1249 cpmac_mii->reset(cpmac_mii); 1254 cpmac_mii->reset(cpmac_mii);
1250 1255
1251 for (i = 0; i < 300; i++) 1256 for (i = 0; i < 300; i++) {
1252 if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE))) 1257 mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE);
1258 if (mask)
1253 break; 1259 break;
1254 else 1260 else
1255 msleep(10); 1261 msleep(10);
1262 }
1256 1263
1257 mask &= 0x7fffffff; 1264 mask &= 0x7fffffff;
1258 if (mask & (mask - 1)) { 1265 if (mask & (mask - 1)) {