2

I previously followed the answer in this question: Attaching USB-Serial device with custom PID to ttyUSB0 on embedded

Now, I need to revert that step so that the device id I echoed to new_id doesn't map to ttyUSB0 every time I connect it. The file, new_id, seems to have '0403 e0d0' permanently written to it now. I've tried to use the unbind file to no luck. There's also no "remove_id" file. Only bind, new_id, uevent, and unbind.

How can I revert this?

2 Answers 2

3

I looked into this, and it does seem like remove_id was never implemented for usb-serial. Should be able to take the work in drivers/usb/core/driver.c and implement remove_id in drivers/usb/serial/bus.c.

Sorry for not having an easy answer.

3
  • Wouldn't reinstalling the kernel fix it? Commented Dec 19, 2022 at 17:00
  • @DimaPasechnik just a reboot would do it. No reinstall. Commented Mar 22, 2023 at 23:07
  • You can also do this without a reboot by removing then adding the serial module. sudo modprobe -r usb_serial_simple; sudo modprobe usb_serial_simple. This doesn't remove individual VID:PIDs that you added but will revert the driver back to it's fresh state. Commented Jan 12, 2024 at 22:05
0

As @robbat2 states. The remove_id attribute isn't implemented for the generic usb-serial driver. Rather than rebooting the entire system though, you can revert your changes by just unloading and reloading the kernel module. Since this wipes the new_id device table you get your desired effect.

Remove the module

sudo modprobe -r usb_serial_simple 

Reinsert the module

sudo modprobe usb_serial_simple 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.