All of lore.kernel.org
 help / color / mirror / Atom feed
From: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
To: <jikos@kernel.org>, <benjamin.tissoires@redhat.com>,
	<linux-input@vger.kernel.org>
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Subject: [PATCH 07/11] HID: amd_sfh: Add remove operation in amd_mp2_ops
Date: Tue, 12 Jul 2022 23:48:32 +0530	[thread overview]
Message-ID: <20220712181836.3488343-8-Basavaraj.Natikar@amd.com> (raw)
In-Reply-To: <20220712181836.3488343-1-Basavaraj.Natikar@amd.com>

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>
---
 drivers/hid/amd-sfh-hid/amd_sfh_common.h | 1 +
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
index 2b45d507ead7..afecf7d2bebe 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
@@ -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);
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index be9ac3778f37..62e6757f889d 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -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)
@@ -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)
-- 
2.25.1


  parent reply	other threads:[~2022-07-12 18:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 18:18 [PATCH 00/11] Fixes and implementation of AMD SFH 1.1 functionality Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 01/11] HID: amd_sfh: Add NULL check for hid device Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 02/11] HID: amd_sfh: Move common macros and structures Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 03/11] HID: amd_sfh: Move request_list struct to header file Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 04/11] HID: amd_sfh: Move request_list variable to client data Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 05/11] HID: amd_sfh: Add descriptor operations in amd_mp2_ops Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 06/11] HID: amd_sfh: Add PM " Basavaraj Natikar
2022-07-12 18:18 ` Basavaraj Natikar [this message]
2022-07-12 18:18 ` [PATCH 08/11] HID: amd_sfh: Move global functions to static Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 09/11] HID: amd_sfh: Move amd_sfh_work to common interface Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 10/11] HID: amd_sfh: Move interrupt handling " Basavaraj Natikar
2022-07-12 18:18 ` [PATCH 11/11] HID: amd_sfh: Implement SFH1.1 functionality Basavaraj Natikar
2022-07-21 11:44 ` [PATCH 00/11] Fixes and implementation of AMD SFH 1.1 functionality Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220712181836.3488343-8-Basavaraj.Natikar@amd.com \
    --to=basavaraj.natikar@amd.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.