Exemplo n.º 1
0
int usb_create_sysfs_dev_files(struct usb_device *udev)
{
    struct device *dev = &udev->dev;
    int retval;

    /* Unforunately these attributes cannot be created before
     * the uevent is broadcast.
     */
    retval = device_create_bin_file(dev, &dev_bin_attr_descriptors);
    if (retval)
        goto error;

    retval = add_persist_attributes(dev);
    if (retval)
        goto error;

    retval = add_power_attributes(dev);
    if (retval)
        goto error;

    retval = usb_create_ep_files(dev, &udev->ep0, udev);
    if (retval)
        goto error;
    return 0;
error:
    usb_remove_sysfs_dev_files(udev);
    return retval;
}
Exemplo n.º 2
0
int usb_create_sysfs_dev_files(struct usb_device *udev)
{
	struct device *dev = &udev->dev;
	int retval;

	retval = device_create_bin_file(dev, &dev_bin_attr_descriptors);
	if (retval)
		goto error;

	retval = add_persist_attributes(dev);
	if (retval)
		goto error;

	retval = add_power_attributes(dev);
	if (retval)
		goto error;
	return retval;
error:
	usb_remove_sysfs_dev_files(udev);
	return retval;
}