[PATCH v2 6/6] Input: touchscreen - use usb_make_subpath()
From: Shihuang Liu
Date: Wed Oct 21 2026 - 08:39:51 EST
The sur40 and usbtouchscreen drivers build their input device physical
paths by appending "/input0" with strlcat() after usb_make_path().
In preparation for removing the deprecated strlcat() API [1], replace
each pair of calls with usb_make_subpath(). The helper formats the
USB path and the "input0" subpath in one call, avoiding a separate
buffer scan and append operation.
Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Shihuang Liu <shlomojune6@xxxxxxxxx>
---
drivers/input/touchscreen/sur40.c | 3 +--
drivers/input/touchscreen/usbtouchscreen.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 77ec2c94b91fd..7702eead123e2 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -690,8 +690,7 @@ static int sur40_probe(struct usb_interface *interface,
/* Set up regular input device structure */
input->name = DRIVER_LONG;
usb_to_input_id(usbdev, &input->id);
- usb_make_path(usbdev, sur40->phys, sizeof(sur40->phys));
- strlcat(sur40->phys, "/input0", sizeof(sur40->phys));
+ usb_make_subpath(usbdev, sur40->phys, sizeof(sur40->phys), "input0");
input->phys = sur40->phys;
input->dev.parent = &interface->dev;
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 0bbacb517c286..fd2b896675dee 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1512,8 +1512,7 @@ static int usbtouch_probe(struct usb_interface *intf,
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct));
- usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
- strlcat(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
+ usb_make_subpath(udev, usbtouch->phys, sizeof(usbtouch->phys), "input0");
input_dev->name = usbtouch->name;
input_dev->phys = usbtouch->phys;
--
2.43.0