diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-24 08:23:20 -0400 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-07-30 07:12:51 -0400 |
commit | 5599e98fe06a88db55133ae8ac53f69216b82c6a (patch) | |
tree | 52ff52fcc968adb961fc1cff193bcc342b6d65b6 | |
parent | 35b7c80827e9352b88a2379f06cbb9aa3dd64c14 (diff) |
platform/x86: ISST: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c index f7266a115a08..ad8c7c0df4d9 100644 --- a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +++ b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c | |||
@@ -132,11 +132,9 @@ static void isst_if_remove(struct pci_dev *pdev) | |||
132 | 132 | ||
133 | static int __maybe_unused isst_if_suspend(struct device *device) | 133 | static int __maybe_unused isst_if_suspend(struct device *device) |
134 | { | 134 | { |
135 | struct pci_dev *pdev = to_pci_dev(device); | 135 | struct isst_if_device *punit_dev = dev_get_drvdata(device); |
136 | struct isst_if_device *punit_dev; | ||
137 | int i; | 136 | int i; |
138 | 137 | ||
139 | punit_dev = pci_get_drvdata(pdev); | ||
140 | for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) | 138 | for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) |
141 | punit_dev->range_0[i] = readl(punit_dev->punit_mmio + | 139 | punit_dev->range_0[i] = readl(punit_dev->punit_mmio + |
142 | mmio_range[0].beg + 4 * i); | 140 | mmio_range[0].beg + 4 * i); |
@@ -149,11 +147,9 @@ static int __maybe_unused isst_if_suspend(struct device *device) | |||
149 | 147 | ||
150 | static int __maybe_unused isst_if_resume(struct device *device) | 148 | static int __maybe_unused isst_if_resume(struct device *device) |
151 | { | 149 | { |
152 | struct pci_dev *pdev = to_pci_dev(device); | 150 | struct isst_if_device *punit_dev = dev_get_drvdata(device); |
153 | struct isst_if_device *punit_dev; | ||
154 | int i; | 151 | int i; |
155 | 152 | ||
156 | punit_dev = pci_get_drvdata(pdev); | ||
157 | for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) | 153 | for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) |
158 | writel(punit_dev->range_0[i], punit_dev->punit_mmio + | 154 | writel(punit_dev->range_0[i], punit_dev->punit_mmio + |
159 | mmio_range[0].beg + 4 * i); | 155 | mmio_range[0].beg + 4 * i); |