I'm trying to use libudev to unbind a usb device from usb-storage driver ..
This does not seem to work. Can I even do what I'm trying to do or am I just doing it wrong ?
In the shell
# echo -n "1-1.1:1.0" > /sys/bus/usb/drivers/usb-storage/unbind
works but this doesn't ...
gchar *sTestUFD= "1-1.1:1.0";
struct udev *udev = udev_new();
struct udev_device *device;
if( (device = udev_device_new_from_syspath( udev, "/sys/bus/usb/drivers/usb-storage" )) != NULL ) {
if( udev_device_set_sysattr_value( device, "unbind", sTestUFD ) < 0 ) {
sd_journal_print( LOG_NOTICE, "Cannot unbind %s", sTestUFD );
}
udev_device_unref( device );
} else {
sd_journal_perror( "Cannot get /sys/bus/usb/drivers/usb-storage" );
}
udev_unref( udev );
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel