提交 d08b8fc0 编写于 作者: T Tomas Winkler 提交者: Greg Kroah-Hartman

mei: remove the reference to pdev from mei_device

For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code.
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1bd30b6a
...@@ -676,7 +676,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) ...@@ -676,7 +676,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
/* Ack the interrupt here /* Ack the interrupt here
* In case of MSI we don't go through the quick handler */ * In case of MSI we don't go through the quick handler */
if (pci_dev_msi_enabled(dev->pdev)) if (pci_dev_msi_enabled(to_pci_dev(dev->dev)))
mei_clear_interrupts(dev); mei_clear_interrupts(dev);
/* check if ME wants a reset */ /* check if ME wants a reset */
...@@ -854,7 +854,6 @@ struct mei_device *mei_me_dev_init(struct pci_dev *pdev, ...@@ -854,7 +854,6 @@ struct mei_device *mei_me_dev_init(struct pci_dev *pdev,
mei_device_init(dev, &pdev->dev, &mei_me_hw_ops); mei_device_init(dev, &pdev->dev, &mei_me_hw_ops);
dev->cfg = cfg; dev->cfg = cfg;
dev->pdev = pdev;
return dev; return dev;
} }
...@@ -998,7 +998,7 @@ irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id) ...@@ -998,7 +998,7 @@ irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
mei_io_list_init(&complete_list); mei_io_list_init(&complete_list);
if (pci_dev_msi_enabled(dev->pdev)) if (pci_dev_msi_enabled(to_pci_dev(dev->dev)))
mei_txe_check_and_ack_intrs(dev, true); mei_txe_check_and_ack_intrs(dev, true);
/* show irq events */ /* show irq events */
...@@ -1157,7 +1157,6 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev, ...@@ -1157,7 +1157,6 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev,
init_waitqueue_head(&hw->wait_aliveness_resp); init_waitqueue_head(&hw->wait_aliveness_resp);
dev->cfg = cfg; dev->cfg = cfg;
dev->pdev = pdev;
return dev; return dev;
} }
......
...@@ -401,7 +401,6 @@ struct mei_cfg { ...@@ -401,7 +401,6 @@ struct mei_cfg {
/** /**
* struct mei_device - MEI private device struct * struct mei_device - MEI private device struct
* @pdev - pointer to pci device struct
* @dev - device on a bus * @dev - device on a bus
* @cdev - character device * @cdev - character device
* @minor - minor number allocated for device * @minor - minor number allocated for device
...@@ -420,7 +419,6 @@ struct mei_cfg { ...@@ -420,7 +419,6 @@ struct mei_cfg {
* @cfg - per device generation config and ops * @cfg - per device generation config and ops
*/ */
struct mei_device { struct mei_device {
struct pci_dev *pdev; /* pointer to pci device struct */
struct device *dev; struct device *dev;
struct cdev cdev; struct cdev cdev;
int minor; int minor;
......
...@@ -430,7 +430,7 @@ static int mei_me_pm_runtime_resume(struct device *device) ...@@ -430,7 +430,7 @@ static int mei_me_pm_runtime_resume(struct device *device)
*/ */
static inline void mei_me_set_pm_domain(struct mei_device *dev) static inline void mei_me_set_pm_domain(struct mei_device *dev)
{ {
struct pci_dev *pdev = dev->pdev; struct pci_dev *pdev = to_pci_dev(dev->dev);
if (pdev->dev.bus && pdev->dev.bus->pm) { if (pdev->dev.bus && pdev->dev.bus->pm) {
dev->pg_domain.ops = *pdev->dev.bus->pm; dev->pg_domain.ops = *pdev->dev.bus->pm;
......
...@@ -378,7 +378,7 @@ static int mei_txe_pm_runtime_resume(struct device *device) ...@@ -378,7 +378,7 @@ static int mei_txe_pm_runtime_resume(struct device *device)
*/ */
static inline void mei_txe_set_pm_domain(struct mei_device *dev) static inline void mei_txe_set_pm_domain(struct mei_device *dev)
{ {
struct pci_dev *pdev = dev->pdev; struct pci_dev *pdev = to_pci_dev(dev->dev);
if (pdev->dev.bus && pdev->dev.bus->pm) { if (pdev->dev.bus && pdev->dev.bus->pm) {
dev->pg_domain.ops = *pdev->dev.bus->pm; dev->pg_domain.ops = *pdev->dev.bus->pm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册