diff options
| author | Dario Pagani <dario.pagani.146@gmail.com> | 2021-10-05 11:29:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 11:29:58 +0200 |
| commit | 53fde059e88a4314d987ab75518edb8ce86cf8a3 (patch) | |
| tree | 22babbcf036c3d3f0a79b1533550cde419b303e1 /hid-tminit.c | |
| parent | dd575faa00717cf2c3be28ee55a3cb609be6e32c (diff) | |
| parent | 28c4fc4c82cf3539f4e49a558db014f0f3f711b5 (diff) | |
| download | hid-tminit-53fde059e88a4314d987ab75518edb8ce86cf8a3.tar.gz hid-tminit-53fde059e88a4314d987ab75518edb8ce86cf8a3.zip | |
Merge pull request #9 from Kimplul/master
Initialize with base info rather than base + attachment
Diffstat (limited to 'hid-tminit.c')
| -rw-r--r-- | hid-tminit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hid-tminit.c b/hid-tminit.c index 71cc0ab..b64d1f0 100644 --- a/hid-tminit.c +++ b/hid-tminit.c @@ -83,7 +83,7 @@ static void tminit_model_handler(struct urb *urb) { struct hid_device *hdev = urb->context; struct tm_wheel *tm_wheel = hid_get_drvdata(hdev); - uint16_t model = 0; + uint8_t model = 0; int i, ret; const struct tm_wheel_info *twi = 0; @@ -93,20 +93,20 @@ static void tminit_model_handler(struct urb *urb) } if (tm_wheel->response->type == cpu_to_le16(0x49)) - model = le16_to_cpu(tm_wheel->response->data.a.model); + model = tm_wheel->response->data.a.model; else if (tm_wheel->response->type == cpu_to_le16(0x47)) - model = le16_to_cpu(tm_wheel->response->data.b.model); + model = tm_wheel->response->data.b.model; else { hid_err(hdev, "Unknown packet type 0x%x, unable to proceed further with wheel init\n", tm_wheel->response->type); return; } for (i = 0; i < tm_wheels_infos_length && !twi; i++) - if (tm_wheels_infos[i].wheel_type == model) + if (tm_wheels_infos[i].model == model) twi = tm_wheels_infos + i; if (twi) - hid_info(hdev, "Wheel with model id 0x%x is a %s\n", model, twi->wheel_name); + hid_info(hdev, "Wheel with model 0x%x is a %s\n", model, twi->wheel_name); else { hid_err(hdev, "Unknown wheel's model id 0x%x, unable to proceed further with wheel init\n", model); return; |
