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>,
Alexander Usyskin <alexander.usyskin@intel.com>
Subject: [RESEND char-misc-next 09/18] mei: push all standard settings into mei_device_init
Date: Mon, 29 Sep 2014 16:31:41 +0300 [thread overview]
Message-ID: <1411997510-29094-10-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1411997510-29094-1-git-send-email-tomas.winkler@intel.com>
Setting of hw_ops and device has should be in
mei_device_init.
We add reference to the parent device and remove
pci dependent cfg
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
drivers/misc/mei/hw-me.c | 6 ++----
drivers/misc/mei/hw-txe.c | 5 ++---
drivers/misc/mei/init.c | 14 ++++++++++++--
drivers/misc/mei/mei_dev.h | 6 +++++-
4 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 56a9caa..df42b6f 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -824,10 +824,8 @@ struct mei_device *mei_me_dev_init(struct pci_dev *pdev,
if (!dev)
return NULL;
- mei_device_init(dev, cfg);
-
- dev->ops = &mei_me_hw_ops;
-
+ 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 1855b3b..fc1a51f 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -1123,14 +1123,13 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev,
if (!dev)
return NULL;
- mei_device_init(dev, cfg);
+ mei_device_init(dev, &pdev->dev, &mei_txe_hw_ops);
hw = to_txe_hw(dev);
init_waitqueue_head(&hw->wait_aliveness_resp);
- dev->ops = &mei_txe_hw_ops;
-
+ dev->cfg = cfg;
dev->pdev = pdev;
return dev;
}
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 5c41f58..ac65976 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -365,7 +365,16 @@ int mei_fw_status(struct mei_device *dev, struct mei_fw_status *fw_status)
}
EXPORT_SYMBOL_GPL(mei_fw_status);
-void mei_device_init(struct mei_device *dev, const struct mei_cfg *cfg)
+/**
+ * mei_device_init -- initialize mei_device structure
+ *
+ * @dev: the mei device
+ * @device: the device structure
+ * @hw_ops: hw operations
+ */
+void mei_device_init(struct mei_device *dev,
+ struct device *device,
+ const struct mei_hw_ops *hw_ops)
{
/* setup our list array */
INIT_LIST_HEAD(&dev->file_list);
@@ -404,7 +413,8 @@ void mei_device_init(struct mei_device *dev, const struct mei_cfg *cfg)
bitmap_set(dev->host_clients_map, 0, 1);
dev->pg_event = MEI_PG_EVENT_IDLE;
- dev->cfg = cfg;
+ dev->ops = hw_ops;
+ dev->dev = device;
}
EXPORT_SYMBOL_GPL(mei_device_init);
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index be7b147..7051430 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -399,6 +399,7 @@ 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
*
@@ -417,6 +418,7 @@ struct mei_cfg {
*/
struct mei_device {
struct pci_dev *pdev; /* pointer to pci device struct */
+ struct device *dev;
struct cdev cdev;
int minor;
@@ -560,7 +562,9 @@ static inline u32 mei_slots2data(int slots)
/*
* mei init function prototypes
*/
-void mei_device_init(struct mei_device *dev, const struct mei_cfg *cfg);
+void mei_device_init(struct mei_device *dev,
+ struct device *device,
+ const struct mei_hw_ops *hw_ops);
int mei_reset(struct mei_device *dev);
int mei_start(struct mei_device *dev);
int mei_restart(struct mei_device *dev);
--
1.9.3
next prev parent reply other threads:[~2014-09-29 13:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 13:31 [RESEND char-misc-next 00/18] mei: resend of rebased patches Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 01/18] mei: add hbm and pg state in devstate debugfs print Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 02/18] mei: debugfs: adjust print buffer Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 03/18] mei: debugfs: add single buffer indicator Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 04/18] mei: pg: fix cat and paste error in comments Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 05/18] mei: fix style warning: Missing a blank line after declarations Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 06/18] mei: nfc: fix style warning Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 07/18] mei: kill error message for allocation failure Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 08/18] mei: move mei_hbm_hdr function from hbm.h the hbm.c Tomas Winkler
2014-09-29 13:31 ` Tomas Winkler [this message]
2014-09-29 13:31 ` [RESEND char-misc-next 10/18] mei: get rid of most of the pci dependencies in mei Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 11/18] mei: move fw_status back to hw ops handlers Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 12/18] mei: remove the reference to pdev from mei_device Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 13/18] mei: push pci cfg structure me hw Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 14/18] mei: remove include to pci header from mei module files Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 15/18] mei: trivial: fix errors in prints in comments Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 16/18] mei: drop me_client_presentation_num Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 17/18] mei: fix KDoc documentation formatting Tomas Winkler
2014-09-29 13:31 ` [RESEND char-misc-next 18/18] mei: fix kernel-doc warnings Tomas Winkler
2014-09-29 15:56 ` [RESEND char-misc-next 00/18] mei: resend of rebased patches Greg KH
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=1411997510-29094-10-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=alexander.usyskin@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®