Commit 2315332
hwmon: fix potential sensor registration fail if of_node is missing
It is not sufficient to check of_node in current device.
In some cases, this would cause the sensor registration to fail.
This patch looks for device's ancestors to find a valid of_node if any.
Fixes: d560168 ("hwmon: (core) New hwmon registration API")
Signed-off-by: Phinex Hung <phinex@realtek.com>
Link: https://lore.kernel.org/r/20230321060224.3819-1-phinex@realtek.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>1 parent 2b91c4a commit 2315332
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| 760 | + | |
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
| |||
826 | 827 | | |
827 | 828 | | |
828 | 829 | | |
829 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
830 | 833 | | |
831 | 834 | | |
832 | 835 | | |
| |||
838 | 841 | | |
839 | 842 | | |
840 | 843 | | |
841 | | - | |
| 844 | + | |
842 | 845 | | |
843 | 846 | | |
844 | 847 | | |
| |||
0 commit comments