aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2010-07-05 16:53:06 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2010-07-18 20:00:34 -0400
commit82f682514a5df89ffb3890627eebf0897b7a84ec (patch)
tree27a3dba7a179102ac5bfdd5935679bd2abd3f70f /include
parent5f279845f9d684661563894d44729a0c706375b4 (diff)
pm_qos: Get rid of the allocation in pm_qos_add_request()
All current users of pm_qos_add_request() have the ability to supply the memory required by the pm_qos routines, so make them do this and eliminate the kmalloc() with pm_qos_add_request(). This has the double benefit of making the call never fail and allowing it to be called from atomic context. Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: mark gross <markgross@thegnar.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/pm_qos_params.h13
-rw-r--r--include/sound/pcm.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b21e4054c12c..2f22119b4b08 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -779,7 +779,7 @@ struct net_device {
779 */ 779 */
780 char name[IFNAMSIZ]; 780 char name[IFNAMSIZ];
781 781
782 struct pm_qos_request_list *pm_qos_req; 782 struct pm_qos_request_list pm_qos_req;
783 783
784 /* device name hash chain */ 784 /* device name hash chain */
785 struct hlist_node name_hlist; 785 struct hlist_node name_hlist;
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
index 8ba440e5eb7f..77cbddb3784c 100644
--- a/include/linux/pm_qos_params.h
+++ b/include/linux/pm_qos_params.h
@@ -1,8 +1,10 @@
1#ifndef _LINUX_PM_QOS_PARAMS_H
2#define _LINUX_PM_QOS_PARAMS_H
1/* interface for the pm_qos_power infrastructure of the linux kernel. 3/* interface for the pm_qos_power infrastructure of the linux kernel.
2 * 4 *
3 * Mark Gross <mgross@linux.intel.com> 5 * Mark Gross <mgross@linux.intel.com>
4 */ 6 */
5#include <linux/list.h> 7#include <linux/plist.h>
6#include <linux/notifier.h> 8#include <linux/notifier.h>
7#include <linux/miscdevice.h> 9#include <linux/miscdevice.h>
8 10
@@ -14,9 +16,12 @@
14#define PM_QOS_NUM_CLASSES 4 16#define PM_QOS_NUM_CLASSES 4
15#define PM_QOS_DEFAULT_VALUE -1 17#define PM_QOS_DEFAULT_VALUE -1
16 18
17struct pm_qos_request_list; 19struct pm_qos_request_list {
20 struct plist_node list;
21 int pm_qos_class;
22};
18 23
19struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value); 24void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
20void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, 25void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
21 s32 new_value); 26 s32 new_value);
22void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req); 27void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
@@ -24,4 +29,6 @@ void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
24int pm_qos_request(int pm_qos_class); 29int pm_qos_request(int pm_qos_class);
25int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier); 30int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
26int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier); 31int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
32int pm_qos_request_active(struct pm_qos_request_list *req);
27 33
34#endif
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index dd76cdede64d..6e3a29732dc4 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -366,7 +366,7 @@ struct snd_pcm_substream {
366 int number; 366 int number;
367 char name[32]; /* substream name */ 367 char name[32]; /* substream name */
368 int stream; /* stream (direction) */ 368 int stream; /* stream (direction) */
369 struct pm_qos_request_list *latency_pm_qos_req; /* pm_qos request */ 369 struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */
370 size_t buffer_bytes_max; /* limit ring buffer size */ 370 size_t buffer_bytes_max; /* limit ring buffer size */
371 struct snd_dma_buffer dma_buffer; 371 struct snd_dma_buffer dma_buffer;
372 unsigned int dma_buf_id; 372 unsigned int dma_buf_id;