diff options
| -rw-r--r-- | drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c index 8e1cf4d789be..2a7cbaa1712d 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | |||
| @@ -81,22 +81,13 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \ | |||
| 81 | struct device_attribute *attr, \ | 81 | struct device_attribute *attr, \ |
| 82 | char *buf) \ | 82 | char *buf) \ |
| 83 | { \ | 83 | { \ |
| 84 | struct pci_dev *pci_dev; \ | 84 | struct proc_thermal_device *proc_dev = dev_get_drvdata(dev); \ |
| 85 | struct platform_device *pdev; \ | ||
| 86 | struct proc_thermal_device *proc_dev; \ | ||
| 87 | \ | 85 | \ |
| 88 | if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \ | 86 | if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \ |
| 89 | dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \ | 87 | dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \ |
| 90 | return 0; \ | 88 | return 0; \ |
| 91 | } \ | 89 | } \ |
| 92 | \ | 90 | \ |
| 93 | if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \ | ||
| 94 | pdev = to_platform_device(dev); \ | ||
| 95 | proc_dev = platform_get_drvdata(pdev); \ | ||
| 96 | } else { \ | ||
| 97 | pci_dev = to_pci_dev(dev); \ | ||
| 98 | proc_dev = pci_get_drvdata(pci_dev); \ | ||
| 99 | } \ | ||
| 100 | return sprintf(buf, "%lu\n",\ | 91 | return sprintf(buf, "%lu\n",\ |
| 101 | (unsigned long)proc_dev->power_limits[index].suffix * 1000); \ | 92 | (unsigned long)proc_dev->power_limits[index].suffix * 1000); \ |
| 102 | } | 93 | } |
