mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Zijun Hu <zijun_hu@icloud.com>,
	linux-kernel@vger.kernel.org,  Zijun Hu <quic_zijuhu@quicinc.com>
Subject: [PATCH 04/27] usb: typec: class: Make device_find_child()'s match function take a const pointer
Date: Sun, 11 Aug 2024 10:24:55 +0800	[thread overview]
Message-ID: <20240811-const_dfc_done-v1-4-9d85e3f943cb@quicinc.com> (raw)
In-Reply-To: <20240811-const_dfc_done-v1-0-9d85e3f943cb@quicinc.com>

From: Zijun Hu <quic_zijuhu@quicinc.com>

In order to adapt for constified device_find_child(), make its match
functions take a const pointer.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/usb/typec/class.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 9262fcd4144f..eaaa51ffca04 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -222,10 +222,10 @@ static DEVICE_ATTR_RO(usb_power_delivery_revision);
 /* ------------------------------------------------------------------------- */
 /* Alternate Modes */
 
-static int altmode_match(struct device *dev, void *data)
+static int altmode_match(struct device *dev, const void *data)
 {
 	struct typec_altmode *adev = to_typec_altmode(dev);
-	struct typec_device_id *id = data;
+	const struct typec_device_id *id = data;
 
 	if (!is_typec_altmode(dev))
 		return 0;
@@ -1161,7 +1161,7 @@ const struct device_type typec_cable_dev_type = {
 	.release = typec_cable_release,
 };
 
-static int cable_match(struct device *dev, void *data)
+static int cable_match(struct device *dev, const void *data)
 {
 	return is_typec_cable(dev);
 }
@@ -1840,7 +1840,7 @@ const struct device_type typec_port_dev_type = {
 /* --------------------------------------- */
 /* Driver callbacks to report role updates */
 
-static int partner_match(struct device *dev, void *data)
+static int partner_match(struct device *dev, const void *data)
 {
 	return is_typec_partner(dev);
 }

-- 
2.34.1


  parent reply	other threads:[~2024-08-11  2:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11  2:24 [PATCH 00/27] driver core: " Zijun Hu
2024-08-11  2:24 ` [PATCH 01/27] driver core: Constify driver API device_find_child() Zijun Hu
2024-08-13  9:48   ` Greg Kroah-Hartman
2024-08-13 10:39     ` quic_zijuhu
2024-08-13 10:52       ` Greg Kroah-Hartman
2024-08-11  2:24 ` [PATCH 02/27] Bluetooth: hci_sysfs: Make device_find_child()'s match function take a const pointer Zijun Hu
2024-08-11  2:24 ` [PATCH 03/27] serial: core: " Zijun Hu
2024-08-11  2:24 ` Zijun Hu [this message]
2024-08-11  2:24 ` [PATCH 05/27] gpio: sim: " Zijun Hu
2024-08-11  2:24 ` [PATCH 06/27] slimbus: core: " Zijun Hu
2024-08-11  2:24 ` [PATCH 07/27] scsi: iscsi: " Zijun Hu
2024-08-11  2:24 ` [PATCH 08/27] scsi: iscsi: Constify driver API iscsi_find_flashnode_sess() Zijun Hu
2024-08-11  2:25 ` [PATCH 09/27] scsi: qla4xxx: Make iscsi_find_flashnode_sess()'s match function take a const pointer Zijun Hu
2024-08-11  2:25 ` [PATCH 10/27] pwm: Make device_find_child()'s " Zijun Hu
2024-08-11  2:25 ` [PATCH 11/27] media: pci: mgb4: " Zijun Hu
2024-08-11  2:25 ` [PATCH 12/27] range.h: Make range_contains() take const struct range * as parameter type Zijun Hu
2024-08-11  2:25 ` [PATCH 13/27] cxl/region: Make device_find_child()'s match function take a const pointer Zijun Hu
2024-08-11  2:25 ` [PATCH 14/27] cxl/pmem: " Zijun Hu
2024-08-11  2:25 ` [PATCH 15/27] cxl/core/pci: " Zijun Hu
2024-08-11  2:25 ` [PATCH 16/27] sparc: vio: " Zijun Hu
2024-08-11  2:25 ` [PATCH 17/27] bus: fsl-mc: " Zijun Hu
2024-08-11  2:25 ` [PATCH 18/27] block: sunvdc: " Zijun Hu
2024-08-11  2:25 ` [PATCH 19/27] firmware: arm_scmi: " Zijun Hu
2024-08-11  2:25 ` [PATCH 20/27] efi: dev-path-parser: " Zijun Hu
2024-08-11  2:25 ` [PATCH 21/27] drm/mediatek: " Zijun Hu
2024-08-11  2:25 ` [PATCH 22/27] nvdimm: " Zijun Hu
2024-08-11  2:25 ` [PATCH 23/27] libnvdimm: " Zijun Hu
2024-08-11  2:25 ` [PATCH 24/27] rpmsg: core: " Zijun Hu
2024-08-11  2:25 ` [PATCH 25/27] thunderbolt: " Zijun Hu
2024-08-11  2:25 ` [PATCH 26/27] net: dsa: " Zijun Hu
2024-08-11  2:25 ` [PATCH 27/27] cxl/test: " Zijun Hu

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=20240811-const_dfc_done-v1-4-9d85e3f943cb@quicinc.com \
    --to=zijun_hu@icloud.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®