LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-19-2020, 12:39 PM   #1
DeanAnderson
LQ Newbie
 
Registered: Nov 2019
Posts: 19

Rep: Reputation: Disabled
how to find device_driver name if we have pointer to device_node?


Hi
In one of my kernel module I have pointer to device_node and pointer to module of interested me another kernel driver. So I have below pointers?

Code:
	struct module *owner;
	struct device_node *of_node;
I need to do something like that in my kernel module:
Code:
if(!strcmp(name of driver, "specific name of driver"))
{
    do sthm
}
How to find pointer to struct* device_driver if I have above?
device_node has const char* name and full_name but those are names of node in device tree which might be chosen freely by user. Instead device_driver name is statically declared in kernel module and it is not changed, example:

Code:
static struct platform_driver some_driver = {
    ....
    .driver = { //this is device_driver type
        .name = DRIVER_NAME, //I need to get access to this one from another module
...
}

Last edited by DeanAnderson; 03-19-2020 at 12:41 PM.
 
  


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
pass pointer,, return pointer??? blizunt7 Programming 3 07-23-2005 01:36 PM
returning data to main() via a pointer to a pointer. slzckboy Programming 3 05-30-2005 01:20 PM
hot to set value of pointer to pointer to a structure in C alix123 Programming 2 11-17-2004 06:40 AM
Pointer to a Pointer Akuma no Houkon Programming 3 06-06-2004 03:51 PM
pointer to pointer question in c lawkh Programming 2 01-29-2004 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:59 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