提交 2baf8a2d 编写于 作者: W Wang Chen 提交者: David S. Miller

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: NWang Chen <wangchen@cn.fujitsu.com>
Acked-by: NKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f757fec4
...@@ -342,7 +342,7 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) ...@@ -342,7 +342,7 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)
static int pvc_open(struct net_device *dev) static int pvc_open(struct net_device *dev)
{ {
pvc_device *pvc = dev->priv; pvc_device *pvc = dev->ml_priv;
if ((pvc->frad->flags & IFF_UP) == 0) if ((pvc->frad->flags & IFF_UP) == 0)
return -EIO; /* Frad must be UP in order to activate PVC */ return -EIO; /* Frad must be UP in order to activate PVC */
...@@ -362,7 +362,7 @@ static int pvc_open(struct net_device *dev) ...@@ -362,7 +362,7 @@ static int pvc_open(struct net_device *dev)
static int pvc_close(struct net_device *dev) static int pvc_close(struct net_device *dev)
{ {
pvc_device *pvc = dev->priv; pvc_device *pvc = dev->ml_priv;
if (--pvc->open_count == 0) { if (--pvc->open_count == 0) {
hdlc_device *hdlc = dev_to_hdlc(pvc->frad); hdlc_device *hdlc = dev_to_hdlc(pvc->frad);
...@@ -381,7 +381,7 @@ static int pvc_close(struct net_device *dev) ...@@ -381,7 +381,7 @@ static int pvc_close(struct net_device *dev)
static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
pvc_device *pvc = dev->priv; pvc_device *pvc = dev->ml_priv;
fr_proto_pvc_info info; fr_proto_pvc_info info;
if (ifr->ifr_settings.type == IF_GET_PROTO) { 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,7 +409,7 @@ static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int pvc_xmit(struct sk_buff *skb, struct net_device *dev) static int pvc_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
pvc_device *pvc = dev->priv; pvc_device *pvc = dev->ml_priv;
if (pvc->state.active) { if (pvc->state.active) {
if (dev->type == ARPHRD_ETHER) { if (dev->type == ARPHRD_ETHER) {
...@@ -1111,7 +1111,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) ...@@ -1111,7 +1111,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
dev->change_mtu = pvc_change_mtu; dev->change_mtu = pvc_change_mtu;
dev->mtu = HDLC_MAX_MTU; dev->mtu = HDLC_MAX_MTU;
dev->tx_queue_len = 0; dev->tx_queue_len = 0;
dev->priv = pvc; dev->ml_priv = pvc;
result = dev_alloc_name(dev, dev->name); result = dev_alloc_name(dev, dev->name);
if (result < 0) { if (result < 0) {
......
...@@ -80,7 +80,7 @@ struct net_device *alloc_hdlcdev(void *priv); ...@@ -80,7 +80,7 @@ struct net_device *alloc_hdlcdev(void *priv);
static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
{ {
return dev->priv; return netdev_priv(dev);
} }
static __inline__ void debug_frame(const struct sk_buff *skb) static __inline__ void debug_frame(const struct sk_buff *skb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册