/* class_compat_create_link - create a compatibility class device link to a bus device @cls: the compatibility class @dev: the target bus device @device_link: an optional device to which a "device" link should be created  */
int class_compat_create_link(struct class_compat *cls, struct device *dev, struct device *device_link)
/* class_compat_create_link - create a compatibility class device link to a bus device @cls: the compatibility class @dev: the target bus device @device_link: an optional device to which a "device" link should be created  */
int class_compat_create_link(struct class_compat *cls, struct device *dev, struct device *device_link)
{
	int error;
	error = sysfs_create_link(cls->kobj, &dev->kobj, dev_name(dev));
	if (error)
		return error;
	if (device_link) {
		error = sysfs_create_link(&dev->kobj, &device_link->kobj,
					  "device");
		if (error)
			sysfs_remove_link(cls->kobj, dev_name(dev));
	}
	return error;
}