Skip to content

Commit

Permalink
HID: amd_sfh: Add remove operation in amd_mp2_ops
Browse files Browse the repository at this point in the history
Add remove operation as part of amd_mp2_ops structure to support all
AMD SOCs and use wherever applicable.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Basavaraj Natikar authored and Jiri Kosina committed Jul 21, 2022
1 parent 9acadc7 commit 722658f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/hid/amd-sfh-hid/amd_sfh_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct amd_mp2_ops {
int (*discovery_status)(struct amd_mp2_dev *privdata);
void (*suspend)(struct amd_mp2_dev *mp2);
void (*resume)(struct amd_mp2_dev *mp2);
void (*remove)(void *privdata);
int (*get_rep_desc)(int sensor_idx, u8 rep_desc[]);
u32 (*get_desc_sz)(int sensor_idx, int descriptor_name);
u8 (*get_feat_rep)(int sensor_idx, int report_id, u8 *feature_report);
Expand Down
4 changes: 3 additions & 1 deletion drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ static struct amd_mp2_ops amd_sfh_ops_v2 = {
.clear_intr = amd_sfh_clear_intr_v2,
.init_intr = amd_sfh_irq_init_v2,
.discovery_status = amd_sfh_dis_sts_v2,
.remove = amd_mp2_pci_remove,
};

static struct amd_mp2_ops amd_sfh_ops = {
.start = amd_start_sensor,
.stop = amd_stop_sensor,
.stop_all = amd_stop_all_sensors,
.remove = amd_mp2_pci_remove,
};

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

amd_sfh_clear_intr(privdata);

return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
return devm_add_action_or_reset(&pdev->dev, privdata->mp2_ops->remove, privdata);
}

static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
Expand Down

0 comments on commit 722658f

Please sign in to comment.