Skip to content

Commit

Permalink
sysfs: fix placement of EXPORT_SYMBOL()
Browse files Browse the repository at this point in the history
The export should happen after the function, not at the bottom of the
file, so fix that up.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Aug 21, 2013
1 parent 9e2a47e commit 1b86675
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
6 changes: 1 addition & 5 deletions fs/sysfs/bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,27 +481,23 @@ void unmap_bin_file(struct sysfs_dirent *attr_sd)
* @kobj: object.
* @attr: attribute descriptor.
*/

int sysfs_create_bin_file(struct kobject *kobj,
const struct bin_attribute *attr)
{
BUG_ON(!kobj || !kobj->sd || !attr);

return sysfs_add_file(kobj->sd, &attr->attr, SYSFS_KOBJ_BIN_ATTR);
}

EXPORT_SYMBOL_GPL(sysfs_create_bin_file);

/**
* sysfs_remove_bin_file - remove binary file for object.
* @kobj: object.
* @attr: attribute descriptor.
*/

void sysfs_remove_bin_file(struct kobject *kobj,
const struct bin_attribute *attr)
{
sysfs_hash_and_remove(kobj->sd, NULL, attr->attr.name);
}

EXPORT_SYMBOL_GPL(sysfs_create_bin_file);
EXPORT_SYMBOL_GPL(sysfs_remove_bin_file);
13 changes: 4 additions & 9 deletions fs/sysfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,14 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr,
* @kobj: object we're creating for.
* @attr: attribute descriptor.
*/

int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
{
BUG_ON(!kobj || !kobj->sd || !attr);

return sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR);

}
EXPORT_SYMBOL_GPL(sysfs_create_file);

int sysfs_create_files(struct kobject *kobj, const struct attribute **ptr)
{
Expand All @@ -590,6 +590,7 @@ int sysfs_create_files(struct kobject *kobj, const struct attribute **ptr)
sysfs_remove_file(kobj, ptr[i]);
return err;
}
EXPORT_SYMBOL_GPL(sysfs_create_files);

/**
* sysfs_add_file_to_group - add an attribute file to a pre-existing group.
Expand Down Expand Up @@ -654,15 +655,13 @@ int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr,
}
EXPORT_SYMBOL_GPL(sysfs_chmod_file);


/**
* sysfs_remove_file - remove an object attribute.
* @kobj: object we're acting for.
* @attr: attribute descriptor.
*
* Hash the attribute name and kill the victim.
*/

void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)
{
const void *ns;
Expand All @@ -672,13 +671,15 @@ void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)

sysfs_hash_and_remove(kobj->sd, ns, attr->name);
}
EXPORT_SYMBOL_GPL(sysfs_remove_file);

void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr)
{
int i;
for (i = 0; ptr[i]; i++)
sysfs_remove_file(kobj, ptr[i]);
}
EXPORT_SYMBOL_GPL(sysfs_remove_files);

/**
* sysfs_remove_file_from_group - remove an attribute file from a group.
Expand Down Expand Up @@ -793,9 +794,3 @@ int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
return 0;
}
EXPORT_SYMBOL_GPL(sysfs_schedule_callback);


EXPORT_SYMBOL_GPL(sysfs_create_file);
EXPORT_SYMBOL_GPL(sysfs_remove_file);
EXPORT_SYMBOL_GPL(sysfs_remove_files);
EXPORT_SYMBOL_GPL(sysfs_create_files);
9 changes: 3 additions & 6 deletions fs/sysfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ int sysfs_create_link(struct kobject *kobj, struct kobject *target,
{
return sysfs_do_create_link(kobj, target, name, 1);
}
EXPORT_SYMBOL_GPL(sysfs_create_link);

/**
* sysfs_create_link_nowarn - create symlink between two objects.
Expand Down Expand Up @@ -166,7 +167,6 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
* @kobj: object we're acting for.
* @name: name of the symlink to remove.
*/

void sysfs_remove_link(struct kobject * kobj, const char * name)
{
struct sysfs_dirent *parent_sd = NULL;
Expand All @@ -178,6 +178,7 @@ void sysfs_remove_link(struct kobject * kobj, const char * name)

sysfs_hash_and_remove(parent_sd, NULL, name);
}
EXPORT_SYMBOL_GPL(sysfs_remove_link);

/**
* sysfs_rename_link - rename symlink in object's directory.
Expand Down Expand Up @@ -223,6 +224,7 @@ int sysfs_rename_link(struct kobject *kobj, struct kobject *targ,
sysfs_put(sd);
return result;
}
EXPORT_SYMBOL_GPL(sysfs_rename_link);

static int sysfs_get_target_path(struct sysfs_dirent *parent_sd,
struct sysfs_dirent *target_sd, char *path)
Expand Down Expand Up @@ -319,8 +321,3 @@ const struct inode_operations sysfs_symlink_inode_operations = {
.getattr = sysfs_getattr,
.permission = sysfs_permission,
};


EXPORT_SYMBOL_GPL(sysfs_create_link);
EXPORT_SYMBOL_GPL(sysfs_remove_link);
EXPORT_SYMBOL_GPL(sysfs_rename_link);

0 comments on commit 1b86675

Please sign in to comment.