@Aakash - The warning shows up because the device’s kobject is being initialized twice.
The first initialization occurs on platform_device_alloc()
and again with platform_device_register()
.
Essentially, it's trying to reinitialize an already set-up object.
Even though the warning appears, it doesn’t affect the functionality. The module loads and unloads fine since the kernel handles this extra initialization without issues.
Hope that helps clarify things!