kobject: modify kobject_get_path() to take a const *
[platform/kernel/linux-starfive.git] / lib / kobject.c
index a0b2dbf..0380ec8 100644 (file)
@@ -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 void fill_kobj_path(struct kobject *kobj, char *path, int length)
+static void 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) {
@@ -136,7 +136,7 @@ static void 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;