compat: fix a typo in pm_qos_update_request for 2.6.35
[~emulex/for-vlad/old/compat.git] / include / linux / compat-2.6.36.h
1 #ifndef LINUX_26_36_COMPAT_H
2 #define LINUX_26_36_COMPAT_H
3
4 #include <linux/version.h>
5
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
7
8 #include <linux/usb.h>
9 #include <pcmcia/cistpl.h>
10 #include <pcmcia/ds.h>
11 #include <linux/pm_qos_params.h>
12
13 #define kparam_block_sysfs_write(a)
14 #define kparam_unblock_sysfs_write(a)
15
16 struct va_format {
17         const char *fmt;
18         va_list *va;
19 };
20
21 #define device_rename(dev, new_name) device_rename(dev, (char *)new_name)
22
23 #ifdef CONFIG_COMPAT_USB_URB_THREAD_FIX
24 #define usb_scuttle_anchored_urbs(anchor)       compat_usb_scuttle_anchored_urbs(anchor)
25 #define usb_get_from_anchor(anchor)     compat_usb_get_from_anchor(anchor)
26 #define usb_unlink_anchored_urbs(anchor)        compat_usb_unlink_anchored_urbs(anchor)
27
28 extern void compat_usb_unlink_anchored_urbs(struct usb_anchor *anchor);
29 extern struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor);
30 extern void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
31 #endif
32
33 /**
34  * pcmcia_read_config_byte() - read a byte from a card configuration register
35  *
36  * pcmcia_read_config_byte() reads a byte from a configuration register in
37  * attribute memory.
38  */
39 static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
40 {
41         int ret;
42         conf_reg_t reg = { 0, CS_READ, where, 0 };
43         ret = pcmcia_access_configuration_register(p_dev, &reg);
44         *val = reg.Value;
45         return ret;
46 }
47
48 /**
49  * pcmcia_write_config_byte() - write a byte to a card configuration register
50  *
51  * pcmcia_write_config_byte() writes a byte to a configuration register in
52  * attribute memory.
53  */
54 static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
55 {
56         conf_reg_t reg = { 0, CS_WRITE, where, val };
57         return pcmcia_access_configuration_register(p_dev, &reg);
58 }
59
60 struct pm_qos_request_list {
61         u32 qos;
62         void *request;
63 };
64
65 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
66
67 #define pm_qos_add_request(_req, _class, _value) do {                   \
68         (_req)->request = #_req;                                        \
69         (_req)->qos = _class;                                           \
70         pm_qos_add_requirement((_class), (_req)->request, (_value));    \
71     } while(0)
72
73 #define pm_qos_update_request(_req, _value)                             \
74         pm_qos_update_requirement((_req)->qos, (_req)->request, (_value))
75
76 #define pm_qos_remove_request(_req)                                     \
77         pm_qos_remove_requirement((_req)->qos, (_req)->request)
78
79 #else
80
81 #define pm_qos_add_request(_req, _class, _value) do {                   \
82         (_req)->request = pm_qos_add_request((_class), (_value));       \
83     } while (0)
84
85 #define pm_qos_update_request(_req, _value)                             \
86         pm_qos_update_request((_req)->request, (_value))
87
88 #define pm_qos_remove_request(_req)                                     \
89         pm_qos_remove_request((_req)->request)
90
91 #endif
92
93 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
94
95 #endif /* LINUX_26_36_COMPAT_H */