aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-core
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-12-04 00:13:13 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-04 00:13:13 -0500
commit0eade1f930fa3ba6461b34baf3ed8fa7c4abc40f (patch)
treeafb133e2f5d39922a05033889457ba6730c1713b /drivers/media/dvb/dvb-core
parentc19f7a34f7cc7543c62ad065952e146dc77d1a38 (diff)
dvb: Kill directly reference of netdev->priv
Simply replace netdev->priv with netdev_priv(). Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/media/dvb/dvb-core')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index c93019ca519e..03fd9dd5c685 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -345,7 +345,7 @@ static inline void reset_ule( struct dvb_net_priv *p )
345 */ 345 */
346static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) 346static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
347{ 347{
348 struct dvb_net_priv *priv = dev->priv; 348 struct dvb_net_priv *priv = netdev_priv(dev);
349 unsigned long skipped = 0L; 349 unsigned long skipped = 0L;
350 const u8 *ts, *ts_end, *from_where = NULL; 350 const u8 *ts, *ts_end, *from_where = NULL;
351 u8 ts_remain = 0, how_much = 0, new_ts = 1; 351 u8 ts_remain = 0, how_much = 0, new_ts = 1;
@@ -460,8 +460,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
460 /* Drop partly decoded SNDU, reset state, resync on PUSI. */ 460 /* Drop partly decoded SNDU, reset state, resync on PUSI. */
461 if (priv->ule_skb) { 461 if (priv->ule_skb) {
462 dev_kfree_skb( priv->ule_skb ); 462 dev_kfree_skb( priv->ule_skb );
463 ((struct dvb_net_priv *) dev->priv)->stats.rx_errors++; 463 priv->stats.rx_errors++;
464 ((struct dvb_net_priv *) dev->priv)->stats.rx_frame_errors++; 464 priv->stats.rx_frame_errors++;
465 } 465 }
466 reset_ule(priv); 466 reset_ule(priv);
467 priv->need_pusi = 1; 467 priv->need_pusi = 1;
@@ -573,7 +573,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
573 if (priv->ule_skb == NULL) { 573 if (priv->ule_skb == NULL) {
574 printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", 574 printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n",
575 dev->name); 575 dev->name);
576 ((struct dvb_net_priv *)dev->priv)->stats.rx_dropped++; 576 priv->stats.rx_dropped++;
577 return; 577 return;
578 } 578 }
579 579
@@ -800,7 +800,8 @@ static void dvb_net_sec(struct net_device *dev,
800{ 800{
801 u8 *eth; 801 u8 *eth;
802 struct sk_buff *skb; 802 struct sk_buff *skb;
803 struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); 803 struct net_device_stats *stats =
804 &((struct dvb_net_priv *) netdev_priv(dev))->stats;
804 int snap = 0; 805 int snap = 0;
805 806
806 /* note: pkt_len includes a 32bit checksum */ 807 /* note: pkt_len includes a 32bit checksum */
@@ -917,7 +918,7 @@ static int dvb_net_filter_sec_set(struct net_device *dev,
917 struct dmx_section_filter **secfilter, 918 struct dmx_section_filter **secfilter,
918 u8 *mac, u8 *mac_mask) 919 u8 *mac, u8 *mac_mask)
919{ 920{
920 struct dvb_net_priv *priv = dev->priv; 921 struct dvb_net_priv *priv = netdev_priv(dev);
921 int ret; 922 int ret;
922 923
923 *secfilter=NULL; 924 *secfilter=NULL;
@@ -961,7 +962,7 @@ static int dvb_net_filter_sec_set(struct net_device *dev,
961static int dvb_net_feed_start(struct net_device *dev) 962static int dvb_net_feed_start(struct net_device *dev)
962{ 963{
963 int ret = 0, i; 964 int ret = 0, i;
964 struct dvb_net_priv *priv = dev->priv; 965 struct dvb_net_priv *priv = netdev_priv(dev);
965 struct dmx_demux *demux = priv->demux; 966 struct dmx_demux *demux = priv->demux;
966 unsigned char *mac = (unsigned char *) dev->dev_addr; 967 unsigned char *mac = (unsigned char *) dev->dev_addr;
967 968
@@ -1060,7 +1061,7 @@ error:
1060 1061
1061static int dvb_net_feed_stop(struct net_device *dev) 1062static int dvb_net_feed_stop(struct net_device *dev)
1062{ 1063{
1063 struct dvb_net_priv *priv = dev->priv; 1064 struct dvb_net_priv *priv = netdev_priv(dev);
1064 int i, ret = 0; 1065 int i, ret = 0;
1065 1066
1066 dprintk("%s\n", __func__); 1067 dprintk("%s\n", __func__);
@@ -1113,7 +1114,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
1113 1114
1114static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) 1115static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc)
1115{ 1116{
1116 struct dvb_net_priv *priv = dev->priv; 1117 struct dvb_net_priv *priv = netdev_priv(dev);
1117 1118
1118 if (priv->multi_num == DVB_NET_MULTICAST_MAX) 1119 if (priv->multi_num == DVB_NET_MULTICAST_MAX)
1119 return -ENOMEM; 1120 return -ENOMEM;
@@ -1165,7 +1166,7 @@ static void wq_set_multicast_list (struct work_struct *work)
1165 1166
1166static void dvb_net_set_multicast_list (struct net_device *dev) 1167static void dvb_net_set_multicast_list (struct net_device *dev)
1167{ 1168{
1168 struct dvb_net_priv *priv = dev->priv; 1169 struct dvb_net_priv *priv = netdev_priv(dev);
1169 schedule_work(&priv->set_multicast_list_wq); 1170 schedule_work(&priv->set_multicast_list_wq);
1170} 1171}
1171 1172
@@ -1185,7 +1186,7 @@ static void wq_restart_net_feed (struct work_struct *work)
1185 1186
1186static int dvb_net_set_mac (struct net_device *dev, void *p) 1187static int dvb_net_set_mac (struct net_device *dev, void *p)
1187{ 1188{
1188 struct dvb_net_priv *priv = dev->priv; 1189 struct dvb_net_priv *priv = netdev_priv(dev);
1189 struct sockaddr *addr=p; 1190 struct sockaddr *addr=p;
1190 1191
1191 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 1192 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -1199,7 +1200,7 @@ static int dvb_net_set_mac (struct net_device *dev, void *p)
1199 1200
1200static int dvb_net_open(struct net_device *dev) 1201static int dvb_net_open(struct net_device *dev)
1201{ 1202{
1202 struct dvb_net_priv *priv = dev->priv; 1203 struct dvb_net_priv *priv = netdev_priv(dev);
1203 1204
1204 priv->in_use++; 1205 priv->in_use++;
1205 dvb_net_feed_start(dev); 1206 dvb_net_feed_start(dev);
@@ -1209,7 +1210,7 @@ static int dvb_net_open(struct net_device *dev)
1209 1210
1210static int dvb_net_stop(struct net_device *dev) 1211static int dvb_net_stop(struct net_device *dev)
1211{ 1212{
1212 struct dvb_net_priv *priv = dev->priv; 1213 struct dvb_net_priv *priv = netdev_priv(dev);
1213 1214
1214 priv->in_use--; 1215 priv->in_use--;
1215 return dvb_net_feed_stop(dev); 1216 return dvb_net_feed_stop(dev);
@@ -1217,7 +1218,7 @@ static int dvb_net_stop(struct net_device *dev)
1217 1218
1218static struct net_device_stats * dvb_net_get_stats(struct net_device *dev) 1219static struct net_device_stats * dvb_net_get_stats(struct net_device *dev)
1219{ 1220{
1220 return &((struct dvb_net_priv*) dev->priv)->stats; 1221 return &((struct dvb_net_priv *) netdev_priv(dev))->stats;
1221} 1222}
1222 1223
1223static const struct header_ops dvb_header_ops = { 1224static const struct header_ops dvb_header_ops = {
@@ -1287,7 +1288,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
1287 1288
1288 dvbnet->device[if_num] = net; 1289 dvbnet->device[if_num] = net;
1289 1290
1290 priv = net->priv; 1291 priv = netdev_priv(net);
1291 priv->net = net; 1292 priv->net = net;
1292 priv->demux = dvbnet->demux; 1293 priv->demux = dvbnet->demux;
1293 priv->pid = pid; 1294 priv->pid = pid;
@@ -1320,7 +1321,7 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num)
1320 1321
1321 if (!dvbnet->state[num]) 1322 if (!dvbnet->state[num])
1322 return -EINVAL; 1323 return -EINVAL;
1323 priv = net->priv; 1324 priv = netdev_priv(net);
1324 if (priv->in_use) 1325 if (priv->in_use)
1325 return -EBUSY; 1326 return -EBUSY;
1326 1327
@@ -1376,7 +1377,7 @@ static int dvb_net_do_ioctl(struct inode *inode, struct file *file,
1376 1377
1377 netdev = dvbnet->device[dvbnetif->if_num]; 1378 netdev = dvbnet->device[dvbnetif->if_num];
1378 1379
1379 priv_data = netdev->priv; 1380 priv_data = netdev_priv(netdev);
1380 dvbnetif->pid=priv_data->pid; 1381 dvbnetif->pid=priv_data->pid;
1381 dvbnetif->feedtype=priv_data->feedtype; 1382 dvbnetif->feedtype=priv_data->feedtype;
1382 break; 1383 break;
@@ -1427,7 +1428,7 @@ static int dvb_net_do_ioctl(struct inode *inode, struct file *file,
1427 1428
1428 netdev = dvbnet->device[dvbnetif->if_num]; 1429 netdev = dvbnet->device[dvbnetif->if_num];
1429 1430
1430 priv_data = netdev->priv; 1431 priv_data = netdev_priv(netdev);
1431 dvbnetif->pid=priv_data->pid; 1432 dvbnetif->pid=priv_data->pid;
1432 break; 1433 break;
1433 } 1434 }