lkml.org 
[lkml]   [2010]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] [8/12] SYSFS: Add sysdev_create/remove_files
    Date

    Allow to create/remove arrays of sysdev attributes

    Just wrappers around sysfs_create/move_files

    Will be used later to clean up some drivers.

    Signed-off-by: Andi Kleen <ak@linux.intel.com>

    ---
    include/linux/sysdev.h | 13 +++++++++++++
    1 file changed, 13 insertions(+)

    Index: linux-2.6.33-rc2-ak/include/linux/sysdev.h
    ===================================================================
    --- linux-2.6.33-rc2-ak.orig/include/linux/sysdev.h
    +++ linux-2.6.33-rc2-ak/include/linux/sysdev.h
    @@ -123,6 +123,19 @@ struct sysdev_attribute {
    extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
    extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);

    +/* Create/remove NULL terminated attribute list */
    +static inline int
    +sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)
    +{
    + return sysfs_create_files(&d->kobj, (const struct attribute **)a);
    +}
    +
    +static inline void
    +sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a)
    +{
    + return sysfs_remove_files(&d->kobj, (const struct attribute **)a);
    +}
    +
    struct sysdev_ext_attribute {
    struct sysdev_attribute attr;
    void *var;

    \
     
     \ /
      Last update: 2010-01-05 12:51    [W:0.022 / U:0.068 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site