Click here to Skip to main content
15,303,151 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all,

I am working as a embedded linux developer and i am new to Linux, i am having a doubt in platform driver, can any one give a explanation on the below structure

C
struct platform_device {
	const char	*name;
	u32		id;
	struct device	dev;
	u32		num_resources;
	struct resource	*resource;
};
I want to know what is the work of id in the structure if we put -1 for id what does it mean


Thanks,
shan

[Edit]Shouting removed from title[/Edit]
Posted
Updated 29-May-13 7:13am
v4
Comments
Matthew Faithfull 29-May-13 12:35pm
   
You might want to give some idea where you found this struct and what you were doing at the time. Linux is quite a large ammount of code and has quite a few uses.
I'm not aware of anything called a 'platform driver' but that doesn't mean it's not familiar to someone else around here.
ZurdoDev 29-May-13 17:53pm
   
I would refer to https://www.kernel.org/doc/Documentation/driver-model/platform.txt

1 solution

id is most times an "identifier" aka "handle". -1 is often used for "invalid value"

PS: here is a more Windows-flavour forum, so with Linux-question it is not the best place to find
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900