diff options
author | mirko <mirko@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-12-13 01:54:56 +0000 |
---|---|---|
committer | mirko <mirko@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-12-13 01:54:56 +0000 |
commit | a95f9f92e2953d5829a29e95644dc4c4bc93f590 (patch) | |
tree | 01f2bf78edb2e3bb1466df9bca72e068632d0e74 /target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch | |
parent | 9fa649271dbc9c83417488203aeb1668a0238c54 (diff) |
change prefix for kernelpatchbase 2.6.26
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13619 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch')
-rwxr-xr-x | target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch b/target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch new file mode 100755 index 000000000..0d1172fd5 --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.26/1233-device-model-Allow-the-creation-of-symlinks-on-sys.patch @@ -0,0 +1,68 @@ +From 2dc4f2819aec1cdd3012cb28396a625d2efb00fd Mon Sep 17 00:00:00 2001 +From: Cesar Eduardo Barros <cesarb@cesarb.net> +Date: Mon, 4 Aug 2008 08:34:50 +0100 +Subject: [PATCH] device model: Allow the creation of symlinks on /sys/bus/*/devices + +Allows the direct creation of symlinks on /sys/bus/*/devices. This is needed +for a compat symlink from gta01-pm-gps.0 to neo1973-pm-gps.0 on the Openmoko +Neo1973 GTA01. + +Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net> +--- + drivers/base/bus.c | 23 +++++++++++++++++++++++ + include/linux/device.h | 5 +++++ + 2 files changed, 28 insertions(+), 0 deletions(-) + +diff --git a/drivers/base/bus.c b/drivers/base/bus.c +index ef522ae..96d495d 100644 +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -141,6 +141,29 @@ void bus_remove_file(struct bus_type *bus, struct bus_attribute *attr) + } + EXPORT_SYMBOL_GPL(bus_remove_file); + ++int bus_create_device_link(struct bus_type *bus, struct kobject *target, ++ const char *name) ++{ ++ int error; ++ if (bus_get(bus)) { ++ error = sysfs_create_link(&bus->p->devices_kset->kobj, target, ++ name); ++ bus_put(bus); ++ } else ++ error = -EINVAL; ++ return error; ++} ++EXPORT_SYMBOL_GPL(bus_create_device_link); ++ ++void bus_remove_device_link(struct bus_type *bus, const char *name) ++{ ++ if (bus_get(bus)) { ++ sysfs_remove_link(&bus->p->devices_kset->kobj, name); ++ bus_put(bus); ++ } ++} ++EXPORT_SYMBOL_GPL(bus_remove_device_link); ++ + static struct kobj_type bus_ktype = { + .sysfs_ops = &bus_sysfs_ops, + }; +diff --git a/include/linux/device.h b/include/linux/device.h +index 6a2d04c..d29b005 100644 +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -51,6 +51,11 @@ extern int __must_check bus_create_file(struct bus_type *, + struct bus_attribute *); + extern void bus_remove_file(struct bus_type *, struct bus_attribute *); + ++extern int __must_check bus_create_device_link(struct bus_type *bus, ++ struct kobject *target, ++ const char *name); ++extern void bus_remove_device_link(struct bus_type *bus, const char *name); ++ + struct bus_type { + const char *name; + struct bus_attribute *bus_attrs; +-- +1.5.6.3 + |