LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-09-2012, 06:47 PM   #1
vlzj
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Rep: Reputation: Disabled
error: 'struct tty_struct' has no member named 'device'


Hello,

I am trying to port a kernel module from 2.4.x kernel to 2.6.33.

I've a problem with tty_struct that had a device member at 2.4.x kernel but it doesn't has a device member at 2.6.33 kernel.

Is there any function to retrieve device member of tty_struct structure? What can I do retrieve device member of tty_struct that doesn't exist at 2.6.33 kernel?

For definition of tty_struct for 2.6.33 kernel:
http://lxr.free-electrons.com/source...?v=2.6.33#L252

Thanks in advance.
 
Old 04-10-2012, 11:54 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Can you use tty_devnum (see line 451)?
Kevin Barry
 
Old 04-10-2012, 03:33 PM   #3
vlzj
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I've googled a lot about this compiling error.

There was a patch exists:

+struct device *tty_get_device(struct tty_struct *tty)
+{
+ dev_t devt = tty_devnum(tty);
+ return class_find_device(tty_class, NULL, &devt, dev_match_devt);
+}

+struct device *tty_get_device(struct tty_struct *tty);

http://www.mentby.com/dmitry-eremin-...ttystruct.html

But I haven't chance to patch and recompile the kernel.

Is there any solution without patch and recompiling the kernel?

Is it possible to retrieve device struct only using the tty_devnum?

Thanks for response.

Thanks in advance.
 
Old 04-10-2012, 05:54 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by vlzj View Post
+ dev_t devt = tty_devnum(tty);
+ return class_find_device(tty_class, NULL, &devt, dev_match_devt);
Just call these two lines where you need to retrieve the device structure.
Kevin Barry
 
Old 04-11-2012, 07:58 PM   #5
vlzj
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Problem is solved with your answer.

Thanks.
 
  


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
‘struct input_dev’ has no member named ‘private’<--error message when making file the_ultimate_samurai Programming 4 05-05-2009 10:30 AM
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

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

All times are GMT -5. The time now is 02:48 AM.

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