Revert "Revert "kobject: modify kobject_get_path() to take a const *""
This reverts commit e7db10fe57
.
It was perserving the ABI, but that is not needed anymore at this point
in time.
Change-Id: Ifc79e504dbf17466a88ac76162ed77dcb5c13d19
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
3792ff78b1
commit
73bffa9caf
@ -115,7 +115,7 @@ extern void kobject_put(struct kobject *kobj);
|
||||
extern const void *kobject_namespace(struct kobject *kobj);
|
||||
extern void kobject_get_ownership(struct kobject *kobj,
|
||||
kuid_t *uid, kgid_t *gid);
|
||||
extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
|
||||
extern char *kobject_get_path(const struct kobject *kobj, gfp_t flag);
|
||||
|
||||
struct kobj_type {
|
||||
void (*release)(struct kobject *kobj);
|
||||
|
@ -94,10 +94,10 @@ static int create_dir(struct kobject *kobj)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_kobj_path_length(struct kobject *kobj)
|
||||
static int get_kobj_path_length(const struct kobject *kobj)
|
||||
{
|
||||
int length = 1;
|
||||
struct kobject *parent = kobj;
|
||||
const struct kobject *parent = kobj;
|
||||
|
||||
/* walk up the ancestors until we hit the one pointing to the
|
||||
* root.
|
||||
@ -112,9 +112,9 @@ static int get_kobj_path_length(struct kobject *kobj)
|
||||
return length;
|
||||
}
|
||||
|
||||
static int fill_kobj_path(struct kobject *kobj, char *path, int length)
|
||||
static int fill_kobj_path(const struct kobject *kobj, char *path, int length)
|
||||
{
|
||||
struct kobject *parent;
|
||||
const struct kobject *parent;
|
||||
|
||||
--length;
|
||||
for (parent = kobj; parent; parent = parent->parent) {
|
||||
@ -140,7 +140,7 @@ static int fill_kobj_path(struct kobject *kobj, char *path, int length)
|
||||
*
|
||||
* Return: The newly allocated memory, caller must free with kfree().
|
||||
*/
|
||||
char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
|
||||
char *kobject_get_path(const struct kobject *kobj, gfp_t gfp_mask)
|
||||
{
|
||||
char *path;
|
||||
int len;
|
||||
|
Loading…
Reference in New Issue
Block a user