]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/amd_nb, hwmon: (k10temp): Simplify amd_pci_dev_to_node_id()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Dec 2024 16:12:02 +0000 (16:12 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 8 Jan 2025 09:59:01 +0000 (10:59 +0100)
commit7dd57db495d49c004fffc77265ffbaccf340aa20
tree87475dd7078ba5002c04236eb85db7ef357eddb8
parent49b96fc0dddc7b3a01c6707fcaad06fc520402ac
x86/amd_nb, hwmon: (k10temp): Simplify amd_pci_dev_to_node_id()

amd_pci_dev_to_node_id() tries to find the AMD node ID of a device by
searching and counting devices.

The AMD node ID of an AMD node device is simply its slot number minus
the AMD node 0 slot number.

Simplify this function and move it to k10temp.c.

  [ Yazen: Update commit message and simplify function. ]

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Co-developed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20241206161210.163701-10-yazen.ghannam@amd.com
arch/x86/include/asm/amd_nb.h
drivers/hwmon/k10temp.c