diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-05-29 13:09:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-30 08:44:43 -0400 |
commit | c6148f8f8ceb18fd6ae3b637c56e8327b73873eb (patch) | |
tree | 67fa4e4a3e1a94c20f2b5bea89c97fb51e87d44e /drivers/misc | |
parent | 139aacf757fc89792c43a79ba99bc2361c98ecd3 (diff) |
mei: me: remove artificial singleton requirement
There is only one device on the platform
drop mei_pdev and the mutex
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/mei/pci-me.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index a727464e9c3f..a2f5520f4060 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -43,9 +43,6 @@ | |||
43 | #include "hw-me.h" | 43 | #include "hw-me.h" |
44 | #include "client.h" | 44 | #include "client.h" |
45 | 45 | ||
46 | /* AMT device is a singleton on the platform */ | ||
47 | static struct pci_dev *mei_pdev; | ||
48 | |||
49 | /* mei_pci_tbl - PCI Device ID Table */ | 46 | /* mei_pci_tbl - PCI Device ID Table */ |
50 | static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { | 47 | static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { |
51 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_82946GZ)}, | 48 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_82946GZ)}, |
@@ -88,8 +85,6 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { | |||
88 | 85 | ||
89 | MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); | 86 | MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); |
90 | 87 | ||
91 | static DEFINE_MUTEX(mei_mutex); | ||
92 | |||
93 | /** | 88 | /** |
94 | * mei_quirk_probe - probe for devices that doesn't valid ME interface | 89 | * mei_quirk_probe - probe for devices that doesn't valid ME interface |
95 | * | 90 | * |
@@ -126,17 +121,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
126 | struct mei_me_hw *hw; | 121 | struct mei_me_hw *hw; |
127 | int err; | 122 | int err; |
128 | 123 | ||
129 | mutex_lock(&mei_mutex); | ||
130 | 124 | ||
131 | if (!mei_me_quirk_probe(pdev, ent)) { | 125 | if (!mei_me_quirk_probe(pdev, ent)) { |
132 | err = -ENODEV; | 126 | err = -ENODEV; |
133 | goto end; | 127 | goto end; |
134 | } | 128 | } |
135 | 129 | ||
136 | if (mei_pdev) { | ||
137 | err = -EEXIST; | ||
138 | goto end; | ||
139 | } | ||
140 | /* enable pci dev */ | 130 | /* enable pci dev */ |
141 | err = pci_enable_device(pdev); | 131 | err = pci_enable_device(pdev); |
142 | if (err) { | 132 | if (err) { |
@@ -195,13 +185,10 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
195 | if (err) | 185 | if (err) |
196 | goto release_irq; | 186 | goto release_irq; |
197 | 187 | ||
198 | mei_pdev = pdev; | ||
199 | pci_set_drvdata(pdev, dev); | 188 | pci_set_drvdata(pdev, dev); |
200 | 189 | ||
201 | schedule_delayed_work(&dev->timer_work, HZ); | 190 | schedule_delayed_work(&dev->timer_work, HZ); |
202 | 191 | ||
203 | mutex_unlock(&mei_mutex); | ||
204 | |||
205 | pr_debug("initialization successful.\n"); | 192 | pr_debug("initialization successful.\n"); |
206 | 193 | ||
207 | return 0; | 194 | return 0; |
@@ -220,7 +207,6 @@ release_regions: | |||
220 | disable_device: | 207 | disable_device: |
221 | pci_disable_device(pdev); | 208 | pci_disable_device(pdev); |
222 | end: | 209 | end: |
223 | mutex_unlock(&mei_mutex); | ||
224 | dev_err(&pdev->dev, "initialization failed.\n"); | 210 | dev_err(&pdev->dev, "initialization failed.\n"); |
225 | return err; | 211 | return err; |
226 | } | 212 | } |
@@ -238,9 +224,6 @@ static void mei_me_remove(struct pci_dev *pdev) | |||
238 | struct mei_device *dev; | 224 | struct mei_device *dev; |
239 | struct mei_me_hw *hw; | 225 | struct mei_me_hw *hw; |
240 | 226 | ||
241 | if (mei_pdev != pdev) | ||
242 | return; | ||
243 | |||
244 | dev = pci_get_drvdata(pdev); | 227 | dev = pci_get_drvdata(pdev); |
245 | if (!dev) | 228 | if (!dev) |
246 | return; | 229 | return; |
@@ -251,8 +234,6 @@ static void mei_me_remove(struct pci_dev *pdev) | |||
251 | dev_err(&pdev->dev, "stop\n"); | 234 | dev_err(&pdev->dev, "stop\n"); |
252 | mei_stop(dev); | 235 | mei_stop(dev); |
253 | 236 | ||
254 | mei_pdev = NULL; | ||
255 | |||
256 | /* disable interrupts */ | 237 | /* disable interrupts */ |
257 | mei_disable_interrupts(dev); | 238 | mei_disable_interrupts(dev); |
258 | 239 | ||