Skip to content

Commit

Permalink
staging: ft1000: Fix private data pointer usage.
Browse files Browse the repository at this point in the history
Assign private data pointer to device for usage in file operations.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Dec 10, 2010
1 parent 9119dee commit 6d96940
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,15 @@ void ft1000_DestroyDevice(struct net_device *dev)
static int ft1000_ChOpen (struct inode *Inode, struct file *File)
{
struct ft1000_info *info;
struct ft1000_device *dev = (struct ft1000_device *)Inode->i_private;
int i,num;

DEBUG("ft1000_ChOpen called\n");
num = (MINOR(Inode->i_rdev) & 0xf);
DEBUG("ft1000_ChOpen: minor number=%d\n", num);

info = File->private_data = netdev_priv(dev->net);

for (i=0; i<5; i++)
DEBUG("pdevobj[%d]=%p\n", i, pdevobj[i]); //aelias [+] reason: down

Expand Down Expand Up @@ -393,8 +396,6 @@ static int ft1000_ChOpen (struct inode *Inode, struct file *File)
info->app_info[i].nTxMsgReject = 0;
info->app_info[i].nRxMsgMiss = 0;

File->private_data = pdevobj[num]->net;

nonseekable_open(Inode, File);
return 0;
}
Expand Down

0 comments on commit 6d96940

Please sign in to comment.