From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, alan@linux.intel.com,
linux-kernel@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 08/21] mei: move me client storage allocation to hbm.c
Date: Tue, 8 Jan 2013 23:07:19 +0200 [thread overview]
Message-ID: <1357679252-12958-9-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1357679252-12958-1-git-send-email-tomas.winkler@intel.com>
rename function to mei_me_cl_allocate to match the current
names convention: mei_hbm_me_cl_allocate
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/hbm.c | 39 ++++++++++++++++++++++++++++++++++++++-
drivers/misc/mei/init.c | 39 ---------------------------------------
drivers/misc/mei/mei_dev.h | 1 -
3 files changed, 38 insertions(+), 41 deletions(-)
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index f0c3fc4..fb9e63b 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -24,6 +24,43 @@
#include "hw-me.h"
/**
+ * mei_hbm_me_cl_allocate - allocates storage for me clients
+ *
+ * @dev: the device structure
+ *
+ * returns none.
+ */
+static void mei_hbm_me_cl_allocate(struct mei_device *dev)
+{
+ struct mei_me_client *clients;
+ int b;
+
+ /* count how many ME clients we have */
+ for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX)
+ dev->me_clients_num++;
+
+ if (dev->me_clients_num <= 0)
+ return;
+
+ kfree(dev->me_clients);
+ dev->me_clients = NULL;
+
+ dev_dbg(&dev->pdev->dev, "memory allocation for ME clients size=%zd.\n",
+ dev->me_clients_num * sizeof(struct mei_me_client));
+ /* allocate storage for ME clients representation */
+ clients = kcalloc(dev->me_clients_num,
+ sizeof(struct mei_me_client), GFP_KERNEL);
+ if (!clients) {
+ dev_err(&dev->pdev->dev, "memory allocation for ME clients failed.\n");
+ dev->dev_state = MEI_DEV_RESETING;
+ mei_reset(dev, 1);
+ return;
+ }
+ dev->me_clients = clients;
+ return;
+}
+
+/**
* mei_hbm_cl_hdr - construct client hbm header
* @cl: - client
* @hbm_cmd: host bus message command
@@ -593,7 +630,7 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
dev->init_clients_timer = 0;
dev->me_client_presentation_num = 0;
dev->me_client_index = 0;
- mei_allocate_me_clients_storage(dev);
+ mei_hbm_me_cl_allocate(dev);
dev->init_clients_state =
MEI_CLIENT_PROPERTIES_MESSAGE;
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 88407df..636639f 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -278,44 +278,5 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
}
-/**
- * allocate_me_clients_storage - allocates storage for me clients
- *
- * @dev: the device structure
- *
- * returns none.
- */
-void mei_allocate_me_clients_storage(struct mei_device *dev)
-{
- struct mei_me_client *clients;
- int b;
-
- /* count how many ME clients we have */
- for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX)
- dev->me_clients_num++;
-
- if (dev->me_clients_num <= 0)
- return ;
-
-
- if (dev->me_clients != NULL) {
- kfree(dev->me_clients);
- dev->me_clients = NULL;
- }
- dev_dbg(&dev->pdev->dev, "memory allocation for ME clients size=%zd.\n",
- dev->me_clients_num * sizeof(struct mei_me_client));
- /* allocate storage for ME clients representation */
- clients = kcalloc(dev->me_clients_num,
- sizeof(struct mei_me_client), GFP_KERNEL);
- if (!clients) {
- dev_dbg(&dev->pdev->dev, "memory allocation for ME clients failed.\n");
- dev->dev_state = MEI_DEV_RESETING;
- mei_reset(dev, 1);
- return ;
- }
- dev->me_clients = clients;
- return ;
-}
-
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 11ff875..d07d81f 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -328,7 +328,6 @@ void mei_reset(struct mei_device *dev, int interrupts);
int mei_hw_init(struct mei_device *dev);
int mei_task_initialize_clients(void *data);
int mei_initialize_clients(struct mei_device *dev);
-void mei_allocate_me_clients_storage(struct mei_device *dev);
--
1.7.4.4
next prev parent reply other threads:[~2013-01-08 21:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 21:07 [char-misc-next 00/21] MEI restructuring Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 01/21] mei: add new hbm.h header to export hbm protocol Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 02/21] mei: move client functions to client.c Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 03/21] mei: fix client functions names Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 04/21] mei: implement mei_cl_connect function Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 05/21] mei: move watchdog prototypes to mei_dev.h from interface.h Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 06/21] mei: rename interface to hw-me Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 07/21] mei: drop read_pending member form struct mei_cl Tomas Winkler
2013-01-08 21:07 ` Tomas Winkler [this message]
2013-01-08 21:07 ` [char-misc-next 09/21] mei: mei_dev.h - remove prototypes of dropped functions Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 10/21] mei: rename remaining amthi strings to amthif Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 11/21] mei: normalize me host client linking routines Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 12/21] mei: move MEI_IAMTHIF_IDLE to amthif host init function Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 13/21] mei: hw-me.c fix kernel doc Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 14/21] mei: remove write only need_reset member of struct mei_device Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 15/21] mei: remove mei_csr_clear_his prototype Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 16/21] mei: don't use cached value for hcsr in mei_hw_reset Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 17/21] mei: use non cached hcsr for interrupt enablement Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 18/21] mei: abstract host and device readieness Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 19/21] mei: reenable mei_hcsr_set abstraction Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 20/21] mei: make host csr and me csr internal to hw-me Tomas Winkler
2013-01-08 21:07 ` [char-misc-next 21/21] mei: move work initialization to mei_device_init 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=1357679252-12958-9-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=alan@linux.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®