Skip to content

Commit 863fcfe

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Add physical location to HID device
when HID device is loaded a wrong string is shown as physical location is not declared. ``` hid-generic 0020:1022:0001.0009: hidraw4: <UNKNOWN> HID v0.00 Device [hid-amdtp 1022:0001] on ``` Hence use amd sfh driver name or device name which is connected to the HID device. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 10f865c commit 863fcfe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/sched.h>
1313

1414
#include "amd_sfh_hid.h"
15+
#include "amd_sfh_pcie.h"
1516

1617
#define AMD_SFH_RESPONSE_TIMEOUT 1500
1718

@@ -120,6 +121,8 @@ static struct hid_ll_driver amdtp_hid_ll_driver = {
120121

121122
int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data)
122123
{
124+
struct amd_mp2_dev *mp2 = container_of(cli_data->in_data, struct amd_mp2_dev, in_data);
125+
struct device *dev = &mp2->pdev->dev;
123126
struct hid_device *hid;
124127
struct amdtp_hid_data *hid_data;
125128
int rc;
@@ -141,6 +144,8 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data)
141144

142145
hid->driver_data = hid_data;
143146
cli_data->hid_sensor_hubs[cur_hid_dev] = hid;
147+
strscpy(hid->phys, dev->driver ? dev->driver->name : dev_name(dev),
148+
sizeof(hid->phys));
144149
hid->bus = BUS_AMD_SFH;
145150
hid->vendor = AMD_SFH_HID_VENDOR;
146151
hid->product = AMD_SFH_HID_PRODUCT;

0 commit comments

Comments
 (0)