Commit c6148f8f authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: me: remove artificial singleton requirement

There is only one device on the platform
drop mei_pdev and the mutex
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 139aacf7
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
#include "hw-me.h" #include "hw-me.h"
#include "client.h" #include "client.h"
/* AMT device is a singleton on the platform */
static struct pci_dev *mei_pdev;
/* mei_pci_tbl - PCI Device ID Table */ /* mei_pci_tbl - PCI Device ID Table */
static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_82946GZ)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_82946GZ)},
...@@ -88,8 +85,6 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { ...@@ -88,8 +85,6 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = {
MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl);
static DEFINE_MUTEX(mei_mutex);
/** /**
* mei_quirk_probe - probe for devices that doesn't valid ME interface * mei_quirk_probe - probe for devices that doesn't valid ME interface
* *
...@@ -126,17 +121,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -126,17 +121,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct mei_me_hw *hw; struct mei_me_hw *hw;
int err; int err;
mutex_lock(&mei_mutex);
if (!mei_me_quirk_probe(pdev, ent)) { if (!mei_me_quirk_probe(pdev, ent)) {
err = -ENODEV; err = -ENODEV;
goto end; goto end;
} }
if (mei_pdev) {
err = -EEXIST;
goto end;
}
/* enable pci dev */ /* enable pci dev */
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) { if (err) {
...@@ -195,13 +185,10 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -195,13 +185,10 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
goto release_irq; goto release_irq;
mei_pdev = pdev;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
schedule_delayed_work(&dev->timer_work, HZ); schedule_delayed_work(&dev->timer_work, HZ);
mutex_unlock(&mei_mutex);
pr_debug("initialization successful.\n"); pr_debug("initialization successful.\n");
return 0; return 0;
...@@ -220,7 +207,6 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -220,7 +207,6 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
disable_device: disable_device:
pci_disable_device(pdev); pci_disable_device(pdev);
end: end:
mutex_unlock(&mei_mutex);
dev_err(&pdev->dev, "initialization failed.\n"); dev_err(&pdev->dev, "initialization failed.\n");
return err; return err;
} }
...@@ -238,9 +224,6 @@ static void mei_me_remove(struct pci_dev *pdev) ...@@ -238,9 +224,6 @@ static void mei_me_remove(struct pci_dev *pdev)
struct mei_device *dev; struct mei_device *dev;
struct mei_me_hw *hw; struct mei_me_hw *hw;
if (mei_pdev != pdev)
return;
dev = pci_get_drvdata(pdev); dev = pci_get_drvdata(pdev);
if (!dev) if (!dev)
return; return;
...@@ -251,8 +234,6 @@ static void mei_me_remove(struct pci_dev *pdev) ...@@ -251,8 +234,6 @@ static void mei_me_remove(struct pci_dev *pdev)
dev_err(&pdev->dev, "stop\n"); dev_err(&pdev->dev, "stop\n");
mei_stop(dev); mei_stop(dev);
mei_pdev = NULL;
/* disable interrupts */ /* disable interrupts */
mei_disable_interrupts(dev); mei_disable_interrupts(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment