mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 4/6] mei: remove the reference to pdev from mei_deivce
Date: Tue,  2 Sep 2014 14:50:02 +0300	[thread overview]
Message-ID: <1409658604-31615-5-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1409658604-31615-1-git-send-email-tomas.winkler@intel.com>

For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/hw-me.c   | 3 +--
 drivers/misc/mei/hw-txe.c  | 3 +--
 drivers/misc/mei/mei_dev.h | 2 --
 drivers/misc/mei/pci-me.c  | 2 +-
 drivers/misc/mei/pci-txe.c | 2 +-
 5 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 678531c..da86310 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -676,7 +676,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
 
 	/* Ack the interrupt here
 	 * 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);
 
 	/* check if ME wants a reset */
@@ -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);
 	dev->cfg  = cfg;
-	dev->pdev = pdev;
 	return dev;
 }
 
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index e4cb9dc..6eef676 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -998,7 +998,7 @@ irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
 	mutex_lock(&dev->device_lock);
 	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);
 
 	/* show irq events */
@@ -1157,7 +1157,6 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev,
 	init_waitqueue_head(&hw->wait_aliveness_resp);
 
 	dev->cfg  = cfg;
-	dev->pdev = pdev;
 	return dev;
 }
 
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 7080fff..5a16cc4 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -401,7 +401,6 @@ struct mei_cfg {
 /**
  * struct mei_device -  MEI private device struct
 
- * @pdev - pointer to pci device struct
  * @dev  - device on a bus
  * @cdev - character device
  * @minor - minor number allocated for device
@@ -420,7 +419,6 @@ struct mei_cfg {
  * @cfg - per device generation config and ops
  */
 struct mei_device {
-	struct pci_dev *pdev;	/* pointer to pci device struct */
 	struct device *dev;
 	struct cdev cdev;
 	int minor;
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 83e8892..a910717 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -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)
 {
-	struct pci_dev *pdev  = dev->pdev;
+	struct pci_dev *pdev  = to_pci_dev(dev->dev);
 
 	if (pdev->dev.bus && pdev->dev.bus->pm) {
 		dev->pg_domain.ops = *pdev->dev.bus->pm;
diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c
index a1f60be..cd9dda7 100644
--- a/drivers/misc/mei/pci-txe.c
+++ b/drivers/misc/mei/pci-txe.c
@@ -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)
 {
-	struct pci_dev *pdev  = dev->pdev;
+	struct pci_dev *pdev  = to_pci_dev(dev->dev);
 
 	if (pdev->dev.bus && pdev->dev.bus->pm) {
 		dev->pg_domain.ops = *pdev->dev.bus->pm;
-- 
1.9.3


  parent reply	other threads:[~2014-09-02 11:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 11:49 [char-misc-next 0/6] mei: remove pci dependency from mei module Tomas Winkler
2014-09-02 11:49 ` [char-misc-next 1/6] mei: push all standard settings into mei_device_init Tomas Winkler
2014-09-24  6:02   ` Greg KH
2014-09-02 11:50 ` [char-misc-next 2/6] mei: get rid of most of the pci dependencies in mei Tomas Winkler
2014-09-02 11:50 ` [char-misc-next 3/6] mei: move fw_status back to hw ops handlers Tomas Winkler
2014-09-02 11:50 ` Tomas Winkler [this message]
2014-09-02 11:50 ` [char-misc-next 5/6] mei: push pci cfg structure me hw Tomas Winkler
2014-09-02 11:50 ` [char-misc-next 6/6] mei: remove include to pci header from mei module files Tomas Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409658604-31615-5-git-send-email-tomas.winkler@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®