Thread (33 messages) 33 messages, 5 authors, 2025-07-14

Re: [PATCH v2] usbip: convert to use faux_device

From: Zongmin Zhou <hidden>
Date: 2025-06-20 02:16:53
Also in: lkml

On 2025/6/19 19:01, Greg KH wrote:
On Wed, Jun 04, 2025 at 02:54:10PM +0800, Zongmin Zhou wrote:
quoted
From: Zongmin Zhou <redacted>

The vhci driver does not need to create a platform device,
it only did so because it was simple to do that in order to
get a place in sysfs to hang some device-specific attributes.
Now the faux device interface is more appropriate,change it
over to use the faux bus instead.

Signed-off-by: Zongmin Zhou <redacted>
---
Changes in v2:
- don't change faux create api,just call probe on vhci_hcd_init.

  drivers/usb/usbip/vhci.h             |  4 +-
  drivers/usb/usbip/vhci_hcd.c         | 86 +++++++++++-----------------
  drivers/usb/usbip/vhci_sysfs.c       | 68 +++++++++++-----------
  tools/usb/usbip/libsrc/vhci_driver.h |  2 +-
  4 files changed, 72 insertions(+), 88 deletions(-)
I get the following build errors from this patch:

drivers/usb/usbip/vhci_hcd.c:1462:12: error: ‘vhci_hcd_resume’ defined but not used [-Werror=unused-function]
  1462 | static int vhci_hcd_resume(struct faux_device *fdev)
       |            ^~~~~~~~~~~~~~~
drivers/usb/usbip/vhci_hcd.c:1418:12: error: ‘vhci_hcd_suspend’ defined but not used [-Werror=unused-function]
  1418 | static int vhci_hcd_suspend(struct faux_device *fdev, pm_message_t state)
       |            ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Are you sure you tested this?
I apologize for not enabling -Werror, which resulted in missing this 
error warning.
I have tested usbip feature use the new patch,but not test system 
suspend/resume.
The faux bus type don't add pm function,and vhci-hcd driver can't 
register it.
Maybe have to add suspend/resume for it.like below:
static const struct bus_type faux_bus_type = {
     .name        = "faux",
     .match        = faux_match,
     .probe        = faux_probe,
     .remove        = faux_remove,
     .resume     = faux_resume,
     .suspend    = faux_suspend,
};

Is that right?
Your expertise would be greatly valued.
Thanks very much.
thanks,

greg k-h
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help