- /*
- * Cannot modify core link values
- */
- if (streq(sysattr, "driver") ||
- streq(sysattr, "subsystem") ||
- streq(sysattr, "module")) {
- ret = -EPERM;
- } else if (!streq(sysattr, "device")) {
- /* resolve custom link to a device */
- strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
- dev = udev_device_new_from_syspath(udev_device->udev, path);
- if (dev != NULL)
- goto restart;
- ret = -ENXIO;
- } else {
- /* Unhandled, to not try to modify anything */
- ret = -EINVAL;
- }