mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
drivers: core: remove device_link argument from class_compat_[create|remove]_link
After 7e722083fc ("i2c: Remove I2C_COMPAT config symbol and related
code") there's no caller left passing a non-null device_link argument.
So remove this argument to simplify the code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/db49131d-fd79-4f23-93f2-0ab541a345fa@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f554b68eaf
commit
827ed8b159
@@ -601,30 +601,10 @@ EXPORT_SYMBOL_GPL(class_compat_unregister);
|
||||
* 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 class_compat_create_link(struct class_compat *cls, struct device *dev)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = sysfs_create_link(cls->kobj, &dev->kobj, dev_name(dev));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/*
|
||||
* Optionally add a "device" link (typically to the parent), as a
|
||||
* class device would have one and we want to provide as much
|
||||
* backwards compatibility as possible.
|
||||
*/
|
||||
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;
|
||||
return sysfs_create_link(cls->kobj, &dev->kobj, dev_name(dev));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(class_compat_create_link);
|
||||
|
||||
@@ -633,14 +613,9 @@ EXPORT_SYMBOL_GPL(class_compat_create_link);
|
||||
* a bus device
|
||||
* @cls: the compatibility class
|
||||
* @dev: the target bus device
|
||||
* @device_link: an optional device to which a "device" link was previously
|
||||
* created
|
||||
*/
|
||||
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link)
|
||||
void class_compat_remove_link(struct class_compat *cls, struct device *dev)
|
||||
{
|
||||
if (device_link)
|
||||
sysfs_remove_link(&dev->kobj, "device");
|
||||
sysfs_remove_link(cls->kobj, dev_name(dev));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(class_compat_remove_link);
|
||||
|
||||
Reference in New Issue
Block a user