LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-14-2018, 10:17 PM   #1
victorwang
Member
 
Registered: Aug 2017
Posts: 30

Rep: Reputation: Disabled
of_get_named_gpio implicit function declaration error


I tried to designed my own driver in freescale BSP Android 4.4.3 source code.
Below is my designed for properties get.

Code:
static const struct of_device_id dido_dt_ids[] = {
	{ .compatible = "winmate,dido", },
};
unsigned int di0_num;

static int dido_get_of_properties(void)
{
	struct device_node *np = of_find_compatible_node(NULL, NULL, dido_dt_ids[0].compatible);
	int i;

    if (!np){
		printk(KERN_WARNING "%s %s() line %d, cannot get device_node \n", __FILE__, __func__, __LINE__);
        return -ENODATA;
    }

	di0_num = of_get_named_gpio(np, "winmate,di0", 0);
	//di_gpio[0] = di0_num;
	if(di0_num<0)
	{
		printk(KERN_WARNING "%s %s() line %d, can not get di0_value gpios!\n", __FILE__, __func__, __LINE__);
		return -ENODATA;
	}
        return 0;
}
When I compile my code it showed below error to me.
drivers/misc/dido.c:96:2: error: implicit declaration of function 'of_get_named_gpio' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors


I could not understand why the declaration is implicit.

Additional note:
Below is my dtsi settings

Code:
dido: winmate-dido {
                compatible = "winmate,dido";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_dido>;
                status = "okay";
                winmate,di0 = <&gpio1 11 0>;/*MX6QDL_PAD_SD2_CMD__GPIO1_IO11*/
                winmate,di1 = <&gpio1 10 0>;/*MX6QDL_PAD_SD2_CMD__GPIO1_IO10*/
                di-amount = <5>;
                do-amount = <5>;
                di-gpi = <15 14 193>;
                do-gpo = <102 103 104 105 178>;
        };
Can anyone help me on this?

Last edited by victorwang; 10-14-2018 at 10:22 PM.
 
Old 10-19-2018, 04:07 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably this helps: https://stackoverflow.com/questions/...on-of-function
 
Old 10-19-2018, 06:26 AM   #3
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
Invest some time in learning one of code tagging systems such as ctags or GNU global and you'll learn that of_get_named_gpio() is defined in linux/of_gpio.h.
 
  


Reply

Tags
drivers, gpio, kernel 4.1, property_traits



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: implicit declaration of function â??find_task_by_pid_typeâ?? sindhu4sind Linux - Newbie 1 05-09-2012 12:27 PM
[SOLVED] error: implicit declaration of function 'i2c_smbus_read_byte_data' sajnanazeer Programming 5 08-18-2011 10:14 AM
why do I get implicit declaration of function 'open' error on linux hellgirl Programming 2 09-13-2009 06:21 PM
implicit declaration of function error HarryBoy Programming 3 09-11-2008 07:29 AM
error:implicit declaration of function ‘get_filesystem_list’ swift_a2002 Programming 1 05-15-2007 03:27 AM

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

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