Skip to content

Commit c092e27

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Move request_list variable to client data
request_list variable can be used in multiple files to support all AMD SOCs. Hence move request_list variable to client data. Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 8c68db6 commit c092e27

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "amd_sfh_pcie.h"
1919
#include "amd_sfh_hid.h"
2020

21-
static struct request_list req_list;
22-
2321
void amd_sfh_set_report(struct hid_device *hid, int report_id,
2422
int report_type)
2523
{
@@ -40,6 +38,7 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
4038
{
4139
struct amdtp_hid_data *hid_data = hid->driver_data;
4240
struct amdtp_cl_data *cli_data = hid_data->cli_data;
41+
struct request_list *req_list = &cli_data->req_list;
4342
int i;
4443

4544
for (i = 0; i < cli_data->num_hid_devices; i++) {
@@ -56,7 +55,7 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
5655
new->report_id = report_id;
5756
cli_data->report_id[i] = report_id;
5857
cli_data->request_done[i] = false;
59-
list_add(&new->list, &req_list.list);
58+
list_add(&new->list, &req_list->list);
6059
break;
6160
}
6261
}
@@ -67,13 +66,14 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
6766
static void amd_sfh_work(struct work_struct *work)
6867
{
6968
struct amdtp_cl_data *cli_data = container_of(work, struct amdtp_cl_data, work.work);
69+
struct request_list *req_list = &cli_data->req_list;
7070
struct amd_input_data *in_data = cli_data->in_data;
7171
struct request_list *req_node;
7272
u8 current_index, sensor_index;
7373
u8 report_id, node_type;
7474
u8 report_size = 0;
7575

76-
req_node = list_last_entry(&req_list.list, struct request_list, list);
76+
req_node = list_last_entry(&req_list->list, struct request_list, list);
7777
list_del(&req_node->list);
7878
current_index = req_node->current_index;
7979
sensor_index = req_node->sensor_idx;
@@ -154,19 +154,21 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
154154
struct amd_input_data *in_data = &privdata->in_data;
155155
struct amdtp_cl_data *cl_data = privdata->cl_data;
156156
struct amd_mp2_sensor_info info;
157+
struct request_list *req_list;
157158
struct device *dev;
158159
u32 feature_report_size;
159160
u32 input_report_size;
160161
int rc, i, status;
161162
u8 cl_idx;
162163

164+
req_list = &cl_data->req_list;
163165
dev = &privdata->pdev->dev;
164166

165167
cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]);
166168

167169
INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work);
168170
INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer);
169-
INIT_LIST_HEAD(&req_list.list);
171+
INIT_LIST_HEAD(&req_list->list);
170172
cl_data->in_data = in_data;
171173

172174
for (i = 0; i < cl_data->num_hid_devices; i++) {

drivers/hid/amd-sfh-hid/amd_sfh_hid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct amdtp_cl_data {
5252
struct amd_input_data *in_data;
5353
struct delayed_work work;
5454
struct delayed_work work_buffer;
55+
struct request_list req_list;
5556
};
5657

5758
/**

0 commit comments

Comments
 (0)