[5/6] driver core: make subsys_dev_iter_exit() static
Commit Message
The function subsys_dev_iter_exit() is not used outside of
drivers/base/bus.c so make it static to that file and remove the global
export.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/bus.c | 3 +--
include/linux/device/bus.h | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
Comments
On Mon, Jan 9, 2023 at 6:58 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The function subsys_dev_iter_exit() is not used outside of
> drivers/base/bus.c so make it static to that file and remove the global
> export.
>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
> ---
> drivers/base/bus.c | 3 +--
> include/linux/device/bus.h | 1 -
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> index 4be73f58d0ad..e0fe07872a74 100644
> --- a/drivers/base/bus.c
> +++ b/drivers/base/bus.c
> @@ -998,11 +998,10 @@ static struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
> * Finish an iteration. Always call this function after iteration is
> * complete whether the iteration ran till the end or not.
> */
> -void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
> +static void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
> {
> klist_iter_exit(&iter->ki);
> }
> -EXPORT_SYMBOL_GPL(subsys_dev_iter_exit);
>
> int subsys_interface_register(struct subsys_interface *sif)
> {
> diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
> index 5a7590bc7913..ffa562f2d975 100644
> --- a/include/linux/device/bus.h
> +++ b/include/linux/device/bus.h
> @@ -154,7 +154,6 @@ struct subsys_dev_iter {
> struct klist_iter ki;
> const struct device_type *type;
> };
> -void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
>
> int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
> int (*fn)(struct device *dev, void *data));
> --
> 2.39.0
>
@@ -998,11 +998,10 @@ static struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
* Finish an iteration. Always call this function after iteration is
* complete whether the iteration ran till the end or not.
*/
-void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
+static void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
{
klist_iter_exit(&iter->ki);
}
-EXPORT_SYMBOL_GPL(subsys_dev_iter_exit);
int subsys_interface_register(struct subsys_interface *sif)
{
@@ -154,7 +154,6 @@ struct subsys_dev_iter {
struct klist_iter ki;
const struct device_type *type;
};
-void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
int (*fn)(struct device *dev, void *data));