query of unexpected behavior with the 'of_find_device_by_node()' function
Hi Linux Kernel Community,
I'm currently working on a custom LCD driver on an ARM-based SoC ("Qualcomm Snapdragon 8850") running Linux kernel version 6.12.38-android16-5-ge01589ce999a-abogki361520241-4k.
I've encountered an unexpected behavior with the of_find_device_by_node() function. I have the following code snippet:
```c
11286 dsi_device = of_find_device_by_node(NULL);
11287 if (dsi_device)
11288 LCD_INFO("hcc ****\n");
```cWhen this code executes, I observe that dsi_device is not NULL. Instead, it points to a struct device that appears to be a reg-dummy device. Consequently, the LCD_INFO message "hcc ****" is printed.
My understanding of of_find_device_by_node(NULL) is that it should typically return NULL, as the function expects a valid struct device_node * argument to find a device associated with a specific device tree node. Passing NULL does not refer to any specific node, and thus I would expect no device to be found. Could you please clarify:
1. Is this behavior (of of_find_device_by_node(NULL) returning a reg-dummy device) considered normal or expected under any specific circumstances, kernel configurations, or platforms?
2. If not, what could be the potential reasons for this observed behavior in my setup? Could it indicate a specific local modification or patch in my kernel sources that alters this function's behavior?
Any insights or guidance would be greatly appreciated.
Thank you.