driver core: class: move EXPORT_SYMBOL_GPL() lines to the correct place

Message ID 20230214144117.158956-1-gregkh@linuxfoundation.org
State New
Headers
Series driver core: class: move EXPORT_SYMBOL_GPL() lines to the correct place |

Commit Message

Greg KH Feb. 14, 2023, 2:41 p.m. UTC
  For some reason, the drivers/base/class.c file still had the "old style"
of exports, at the end of the file.  Move the exports to the proper
location, right after the function, to be correct.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/class.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
  

Comments

Rafael J. Wysocki Feb. 14, 2023, 2:42 p.m. UTC | #1
On Tue, Feb 14, 2023 at 3:41 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> For some reason, the drivers/base/class.c file still had the "old style"
> of exports, at the end of the file.  Move the exports to the proper
> location, right after the function, to be correct.
>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>

Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>

> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/base/class.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index 89d4528fcc1a..2373b3e210d8 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -99,6 +99,7 @@ int class_create_file_ns(struct class *cls, const struct class_attribute *attr,
>                 error = -EINVAL;
>         return error;
>  }
> +EXPORT_SYMBOL_GPL(class_create_file_ns);
>
>  void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
>                           const void *ns)
> @@ -106,6 +107,7 @@ void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
>         if (cls)
>                 sysfs_remove_file_ns(&cls->p->subsys.kobj, &attr->attr, ns);
>  }
> +EXPORT_SYMBOL_GPL(class_remove_file_ns);
>
>  static struct class *class_get(struct class *cls)
>  {
> @@ -213,6 +215,7 @@ void class_unregister(struct class *cls)
>         class_remove_groups(cls, cls->class_groups);
>         kset_unregister(&cls->p->subsys);
>  }
> +EXPORT_SYMBOL_GPL(class_unregister);
>
>  static void class_create_release(struct class *cls)
>  {
> @@ -276,6 +279,7 @@ void class_destroy(struct class *cls)
>
>         class_unregister(cls);
>  }
> +EXPORT_SYMBOL_GPL(class_destroy);
>
>  /**
>   * class_dev_iter_init - initialize class device iterator
> @@ -460,6 +464,7 @@ int class_interface_register(struct class_interface *class_intf)
>
>         return 0;
>  }
> +EXPORT_SYMBOL_GPL(class_interface_register);
>
>  void class_interface_unregister(struct class_interface *class_intf)
>  {
> @@ -482,6 +487,7 @@ void class_interface_unregister(struct class_interface *class_intf)
>
>         class_put(parent);
>  }
> +EXPORT_SYMBOL_GPL(class_interface_unregister);
>
>  ssize_t show_class_attr_string(struct class *class,
>                                struct class_attribute *attr, char *buf)
> @@ -588,11 +594,3 @@ int __init classes_init(void)
>                 return -ENOMEM;
>         return 0;
>  }
> -
> -EXPORT_SYMBOL_GPL(class_create_file_ns);
> -EXPORT_SYMBOL_GPL(class_remove_file_ns);
> -EXPORT_SYMBOL_GPL(class_unregister);
> -EXPORT_SYMBOL_GPL(class_destroy);
> -
> -EXPORT_SYMBOL_GPL(class_interface_register);
> -EXPORT_SYMBOL_GPL(class_interface_unregister);
> --
> 2.39.1
>
  

Patch

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 89d4528fcc1a..2373b3e210d8 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -99,6 +99,7 @@  int class_create_file_ns(struct class *cls, const struct class_attribute *attr,
 		error = -EINVAL;
 	return error;
 }
+EXPORT_SYMBOL_GPL(class_create_file_ns);
 
 void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
 			  const void *ns)
@@ -106,6 +107,7 @@  void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
 	if (cls)
 		sysfs_remove_file_ns(&cls->p->subsys.kobj, &attr->attr, ns);
 }
+EXPORT_SYMBOL_GPL(class_remove_file_ns);
 
 static struct class *class_get(struct class *cls)
 {
@@ -213,6 +215,7 @@  void class_unregister(struct class *cls)
 	class_remove_groups(cls, cls->class_groups);
 	kset_unregister(&cls->p->subsys);
 }
+EXPORT_SYMBOL_GPL(class_unregister);
 
 static void class_create_release(struct class *cls)
 {
@@ -276,6 +279,7 @@  void class_destroy(struct class *cls)
 
 	class_unregister(cls);
 }
+EXPORT_SYMBOL_GPL(class_destroy);
 
 /**
  * class_dev_iter_init - initialize class device iterator
@@ -460,6 +464,7 @@  int class_interface_register(struct class_interface *class_intf)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(class_interface_register);
 
 void class_interface_unregister(struct class_interface *class_intf)
 {
@@ -482,6 +487,7 @@  void class_interface_unregister(struct class_interface *class_intf)
 
 	class_put(parent);
 }
+EXPORT_SYMBOL_GPL(class_interface_unregister);
 
 ssize_t show_class_attr_string(struct class *class,
 			       struct class_attribute *attr, char *buf)
@@ -588,11 +594,3 @@  int __init classes_init(void)
 		return -ENOMEM;
 	return 0;
 }
-
-EXPORT_SYMBOL_GPL(class_create_file_ns);
-EXPORT_SYMBOL_GPL(class_remove_file_ns);
-EXPORT_SYMBOL_GPL(class_unregister);
-EXPORT_SYMBOL_GPL(class_destroy);
-
-EXPORT_SYMBOL_GPL(class_interface_register);
-EXPORT_SYMBOL_GPL(class_interface_unregister);