[PATCH 04/27] usb: typec: class: Make device_find_child()'s match function take a const pointer
From: Zijun Hu
Date: Sat Aug 10 2024 - 22:26:13 EST
From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
In order to adapt for constified device_find_child(), make its match
functions take a const pointer.
Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
---
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