]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mei: move me client storage allocation to hbm.c
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 8 Jan 2013 21:07:19 +0000 (23:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2013 00:40:45 +0000 (16:40 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/hbm.c
drivers/misc/mei/init.c
drivers/misc/mei/mei_dev.h

index f0c3fc4590d561272cb1826b93f7662dfa81d8d2..fb9e63ba3bb1b2495897d0f139d308425d3d2ac9 100644 (file)
 #include "hbm.h"
 #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
@@ -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;
 
index 88407dfd855793add5edc17cfea22a058a2d0787..636639fbfc0a5d5186f2d9a9fa02f1cbe544757f 100644 (file)
@@ -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 ;
-}
-
 
 
index 11ff875e8658369aa77b30277a79fd3d79047a5a..d07d81ffbb5784dab04e5bc9b148a3a18d25e842 100644 (file)
@@ -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);