# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1196 -> 1.1197 # drivers/base/core.c 1.65 -> 1.66 # include/linux/device.h 1.87 -> 1.88 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/03 jejb@raven.il.steeleye.com 1.1197 # sysfs: add default show/store for bus_type # # These are used if the device_attribute show/store are empty. They # allow buses to do string based parsing of the device properties. # -------------------------------------------- # diff -Nru a/drivers/base/core.c b/drivers/base/core.c --- a/drivers/base/core.c Sat May 3 14:18:21 2003 +++ b/drivers/base/core.c Sat May 3 14:18:21 2003 @@ -42,6 +42,8 @@ if (dev_attr->show) ret = dev_attr->show(dev,buf); + else if (dev->bus->show) + ret = dev->bus->show(dev, buf, attr); return ret; } @@ -55,6 +57,8 @@ if (dev_attr->store) ret = dev_attr->store(dev,buf,count); + else if (dev->bus->store) + ret = dev->bus->store(dev,buf,count,attr); return ret; } diff -Nru a/include/linux/device.h b/include/linux/device.h --- a/include/linux/device.h Sat May 3 14:18:21 2003 +++ b/include/linux/device.h Sat May 3 14:18:21 2003 @@ -74,6 +74,10 @@ struct device * (*add) (struct device * parent, char * bus_id); int (*hotplug) (struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); + ssize_t (*show)(struct device * dev, char * buf, + struct attribute *attr); + ssize_t (*store)(struct device * dev, const char * buf, size_t count, + struct attribute *attr); };