LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Registering dummy driver with power supply subsystem (https://www.linuxquestions.org/questions/linux-kernel-70/registering-dummy-driver-with-power-supply-subsystem-4175512995/)

raj.pandey 08-01-2014 12:23 PM

Registering dummy driver with power supply subsystem
 
Hi Experts,

It might sound a bit naive. I am working on a dummy driver which needs to load on a pre-condition. Driver needs to register with the power supply subsystem and does the reporting after consolidating from other drivers. Driver is not associated with any hardware so presumably no parent device.
I am initializing the device via platform_device_alloc and adding via platform_device_add. In the probe function, I am registering with the power supply subsystem via power_supply_register call and it is failing in that call. I am not getting any stack dump to figure what what exactly is failing but my suspicion is device_add call.
The suspicion more so with device_add call because this call is already made during platform_device_add call and since same device is used in registering with power supply subsystem. Ideally if the device is already added earlier the next call to device_add should simply fail and my driver should not be able to register with the PSS, but frustrating part is I am not able to figure out where the system is crashing because as I said earlier, not stack dump :(.

Appreciate if someone could help.


All times are GMT -5. The time now is 03:17 PM.