Skip to content

Commit 722658f

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Add remove operation in amd_mp2_ops
Add remove operation as part of amd_mp2_ops structure to support all AMD SOCs and use wherever applicable. Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 9acadc7 commit 722658f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct amd_mp2_ops {
5656
int (*discovery_status)(struct amd_mp2_dev *privdata);
5757
void (*suspend)(struct amd_mp2_dev *mp2);
5858
void (*resume)(struct amd_mp2_dev *mp2);
59+
void (*remove)(void *privdata);
5960
int (*get_rep_desc)(int sensor_idx, u8 rep_desc[]);
6061
u32 (*get_desc_sz)(int sensor_idx, int descriptor_name);
6162
u8 (*get_feat_rep)(int sensor_idx, int report_id, u8 *feature_report);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,14 @@ static struct amd_mp2_ops amd_sfh_ops_v2 = {
252252
.clear_intr = amd_sfh_clear_intr_v2,
253253
.init_intr = amd_sfh_irq_init_v2,
254254
.discovery_status = amd_sfh_dis_sts_v2,
255+
.remove = amd_mp2_pci_remove,
255256
};
256257

257258
static struct amd_mp2_ops amd_sfh_ops = {
258259
.start = amd_start_sensor,
259260
.stop = amd_stop_sensor,
260261
.stop_all = amd_stop_all_sensors,
262+
.remove = amd_mp2_pci_remove,
261263
};
262264

263265
static void mp2_select_ops(struct amd_mp2_dev *privdata)
@@ -333,7 +335,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
333335

334336
amd_sfh_clear_intr(privdata);
335337

336-
return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
338+
return devm_add_action_or_reset(&pdev->dev, privdata->mp2_ops->remove, privdata);
337339
}
338340

339341
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)

0 commit comments

Comments
 (0)