LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-03-2009, 10:26 PM   #1
the_ultimate_samurai
Member
 
Registered: Jan 2006
Distribution: debian-lenny
Posts: 37

Rep: Reputation: 15
‘struct input_dev’ has no member named ‘private’<--error message when making file


i get this error in response to this and similar bits:
static int wiidriver_release(struct inode *inode,struct file *file)
{
struct input_dev *input_wii = file->private_data;
kfree(input_wii->private);
input_unregister_device(input_wii);
module_put(THIS_MODULE); /*decrement use count*/
return 0;
}

open, read, release, and write all have that kfree line which is whats erroring....(im sure i dont have to tell you this is a kernel module)

i'll admit to know knowing quite what this does (it works so i never felt the need to modify it, it has remained in this form since i got it) anyhow this code worked on my last system, its from a previously released wiimote driver (WMD) which i heavily modified. thats part of the 9% left untouched since i dont understand it much...

well anyhow this worked fine and now it doesnt, the code hasnt changed so does this mean there was a change in input_dev
uname -a:
Linux debian 2.6.26-2-686 #1 SMP Thu Mar 26 01:08:11 UTC 2009 i686 GNU/Linux
 
Old 05-04-2009, 03:01 PM   #2
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
The 'private' member has been removed from the input_dev struct.

Use the input_{get|set}_drvdata() methods instead.

Please see this thread in the linux kernel archives for more info:

http://lkml.org/lkml/2008/4/21/195

hth
 
Old 05-04-2009, 04:56 PM   #3
the_ultimate_samurai
Member
 
Registered: Jan 2006
Distribution: debian-lenny
Posts: 37

Original Poster
Rep: Reputation: 15
ah thanks, that helped (though i do get some new warnings...says its an incompatable data type pointer) and the driver no longer works...
 
Old 05-04-2009, 09:40 PM   #4
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
One can (as you probably already know) usually fix the incompatible pointer type by casting. I'm not familiar enough with your driver code to be able to help much more than that... there may be other kernel changes or a host of possibilities that could make the driver not function.
 
Old 05-05-2009, 10:30 AM   #5
the_ultimate_samurai
Member
 
Registered: Jan 2006
Distribution: debian-lenny
Posts: 37

Original Poster
Rep: Reputation: 15
im not sure what to cast it to, the dev_get_drvdata() takes a pointer to type input_dev:
Code:
static int wiidriver_release(struct inode *inode,struct file *file)
{
	struct input_dev *input_wii = file->private_data;
	kfree(dev_get_drvdata(input_wii));
	input_unregister_device(input_wii);
	module_put(THIS_MODULE); /*decrement use count*/
	return 0;
}
as you can see input_wii is type input_dev...im not sure about this file->private_data im afraid kernel modules are still quite unfamiliar to me.

the driver btw, does not currently work...i suspect those warnings are the cause.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error: ‘struct in6_addr’ has no member named ‘in6_u’ deb1513 Programming 1 12-02-2008 06:56 AM
error: 'struct SDL_SysWMinfo' has no member named 'info' TiDjY Linux - Desktop 4 11-24-2008 06:00 AM
error: ‘struct tcphdr’ has no member named ‘th_flags’ nasim751 Linux - Software 0 04-17-2008 05:55 AM
error: ‘struct inode’ has no member named ‘u’ PankajDS Linux - Kernel 0 02-25-2008 11:34 PM
access struct member error true_atlantis Programming 4 04-25-2006 05:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration