diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-21 19:34:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 19:34:18 -0500 |
commit | 2baf8a2daab65cdd3f20bfeb4676a2f6aff7c3bf (patch) | |
tree | 957eb111fad4ce334ff8d49861a08d1fcf14e64a | |
parent | f757fec4b0d45dfcb52f9a914a12225a6a0a3e05 (diff) |
netdevice hdlc: Convert directly reference of netdev->priv
For killing directly reference of netdev->priv, use netdev->ml_priv to replace it.
Because the private pvc data comes from add_pvc() and can't be allocated in
alloc_netdev().
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wan/hdlc_fr.c | 10 | ||||
-rw-r--r-- | include/linux/hdlc.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index d3d5055741ad..f1ddd7c3459c 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -342,7 +342,7 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) | |||
342 | 342 | ||
343 | static int pvc_open(struct net_device *dev) | 343 | static int pvc_open(struct net_device *dev) |
344 | { | 344 | { |
345 | pvc_device *pvc = dev->priv; | 345 | pvc_device *pvc = dev->ml_priv; |
346 | 346 | ||
347 | if ((pvc->frad->flags & IFF_UP) == 0) | 347 | if ((pvc->frad->flags & IFF_UP) == 0) |
348 | return -EIO; /* Frad must be UP in order to activate PVC */ | 348 | return -EIO; /* Frad must be UP in order to activate PVC */ |
@@ -362,7 +362,7 @@ static int pvc_open(struct net_device *dev) | |||
362 | 362 | ||
363 | static int pvc_close(struct net_device *dev) | 363 | static int pvc_close(struct net_device *dev) |
364 | { | 364 | { |
365 | pvc_device *pvc = dev->priv; | 365 | pvc_device *pvc = dev->ml_priv; |
366 | 366 | ||
367 | if (--pvc->open_count == 0) { | 367 | if (--pvc->open_count == 0) { |
368 | hdlc_device *hdlc = dev_to_hdlc(pvc->frad); | 368 | hdlc_device *hdlc = dev_to_hdlc(pvc->frad); |
@@ -381,7 +381,7 @@ static int pvc_close(struct net_device *dev) | |||
381 | 381 | ||
382 | static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 382 | static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
383 | { | 383 | { |
384 | pvc_device *pvc = dev->priv; | 384 | pvc_device *pvc = dev->ml_priv; |
385 | fr_proto_pvc_info info; | 385 | fr_proto_pvc_info info; |
386 | 386 | ||
387 | if (ifr->ifr_settings.type == IF_GET_PROTO) { | 387 | if (ifr->ifr_settings.type == IF_GET_PROTO) { |
@@ -409,7 +409,7 @@ static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
409 | 409 | ||
410 | static int pvc_xmit(struct sk_buff *skb, struct net_device *dev) | 410 | static int pvc_xmit(struct sk_buff *skb, struct net_device *dev) |
411 | { | 411 | { |
412 | pvc_device *pvc = dev->priv; | 412 | pvc_device *pvc = dev->ml_priv; |
413 | 413 | ||
414 | if (pvc->state.active) { | 414 | if (pvc->state.active) { |
415 | if (dev->type == ARPHRD_ETHER) { | 415 | if (dev->type == ARPHRD_ETHER) { |
@@ -1111,7 +1111,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) | |||
1111 | dev->change_mtu = pvc_change_mtu; | 1111 | dev->change_mtu = pvc_change_mtu; |
1112 | dev->mtu = HDLC_MAX_MTU; | 1112 | dev->mtu = HDLC_MAX_MTU; |
1113 | dev->tx_queue_len = 0; | 1113 | dev->tx_queue_len = 0; |
1114 | dev->priv = pvc; | 1114 | dev->ml_priv = pvc; |
1115 | 1115 | ||
1116 | result = dev_alloc_name(dev, dev->name); | 1116 | result = dev_alloc_name(dev, dev->name); |
1117 | if (result < 0) { | 1117 | if (result < 0) { |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index c59769693bee..e960faac609d 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -80,7 +80,7 @@ struct net_device *alloc_hdlcdev(void *priv); | |||
80 | 80 | ||
81 | static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) | 81 | static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) |
82 | { | 82 | { |
83 | return dev->priv; | 83 | return netdev_priv(dev); |
84 | } | 84 | } |
85 | 85 | ||
86 | static __inline__ void debug_frame(const struct sk_buff *skb) | 86 | static __inline__ void debug_frame(const struct sk_buff *skb) |