linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Question: Drivers/base/core.c] Why dev->init_name = NULL in device_add function ?
@ 2014-08-01 17:25 Aniroop Mathur
  2014-08-01 19:23 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Aniroop Mathur @ 2014-08-01 17:25 UTC (permalink / raw)
  To: linux-kernel, linux-hotplug, gregkh

Dear Mr. Greg Kroah-Hartman and Linux Community,
Greetings of the day !! :)

I am Aniroop Mathur working on Linux Kernel for last two years.
I am stuck at one point and could not find the solution over internet.
I posted on linuxquestions.org too.
So I need your help and suggestion for it.

Can you please help in answering my query as below:

==========================In function device_add of /drivers/base/core.c file, it is mentioned:
/*
* for statically allocated devices, which should all be converted
* some day, we need to initialize the name. We prevent reading back
* the name, and force the use of dev_name()
*/
if (dev->init_name) {
dev_set_name(dev, "%s", dev->init_name);
dev->init_name = NULL;
}


Except forcing the use of dev_name to read device name,
Is there any other reason to make init_name as NULL ?
And if it is not made NULL, is there any problem or side-effect ?

===========================
Link at linuxquestions.org:
http://www.linuxquestions.org/questions/linux-kernel-70/why-dev-init_name-%3D-null-in-device_add-function-4175504749/


Thanks a lot in advance !

Best Regards,
Aniroop Mathur

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-08-04 17:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01 17:25 [Question: Drivers/base/core.c] Why dev->init_name = NULL in device_add function ? Aniroop Mathur
2014-08-01 19:23 ` Greg KH
2014-08-01 22:36   ` Aniroop Mathur
2014-08-01 22:41     ` Greg KH
2014-08-01 23:56       ` Aniroop Mathur
2014-08-02  2:39         ` Greg KH
2014-08-03 18:54           ` Aniroop Mathur
2014-08-04  4:35             ` Greg KH
2014-08-04 17:11               ` Aniroop Mathur
2014-08-03 16:25         ` Aniroop Mathur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).