Commit 24491ef6 authored by Phinex Hung's avatar Phinex Hung Committed by sanglipeng
Browse files

hwmon: fix potential sensor registration fail if of_node is missing

stable inclusion
from stable-v5.10.177
commit 33c2fa39fb9e7b3346e53fba055d5cacf9af6dce
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=33c2fa39fb9e7b3346e53fba055d5cacf9af6dce



--------------------------------

[ Upstream commit 2315332e ]

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: d560168b ("hwmon: (core) New hwmon registration API")
Signed-off-by: default avatarPhinex Hung <phinex@realtek.com>
Link: https://lore.kernel.org/r/20230321060224.3819-1-phinex@realtek.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 1e069eb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment