[PATCH 04/16] blspec: don't export blspec functions
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Apr 1 03:47:54 PDT 2025
All of these functions are used only internally and need not be visible
externally.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
common/blspec.c | 52 +++++++++++++++++++++++++++++-------------------
include/blspec.h | 27 -------------------------
2 files changed, 32 insertions(+), 47 deletions(-)
delete mode 100644 include/blspec.h
diff --git a/common/blspec.c b/common/blspec.c
index c4e65906ad9f..d2db9f0db9fa 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -7,7 +7,6 @@
#include <readkey.h>
#include <common.h>
#include <driver.h>
-#include <blspec.h>
#include <malloc.h>
#include <block.h>
#include <fcntl.h>
@@ -19,13 +18,39 @@
#include <fs.h>
#include <of.h>
#include <linux/stat.h>
+#include <linux/list.h>
#include <linux/err.h>
#include <mtd/ubi-user.h>
+#include <boot.h>
+
+struct blspec_entry {
+ struct bootentry entry;
+
+ struct device_node *node;
+ struct cdev *cdev;
+ const char *rootpath;
+ const char *configpath;
+};
+
+static int blspec_scan_device(struct bootentries *bootentries, struct device *dev);
+
+/*
+ * blspec_entry_var_get - get the value of a variable
+ */
+static const char *blspec_entry_var_get(struct blspec_entry *entry, const char *name)
+{
+ const char *str;
+ int ret;
+
+ ret = of_property_read_string(entry->node, name, &str);
+
+ return ret ? NULL : str;
+}
/*
* blspec_entry_var_set - set a variable to a value
*/
-int blspec_entry_var_set(struct blspec_entry *entry, const char *name,
+static int blspec_entry_var_set(struct blspec_entry *entry, const char *name,
const char *val)
{
return of_set_property(entry->node, name, val,
@@ -154,19 +179,6 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
return ret;
}
-/*
- * blspec_entry_var_get - get the value of a variable
- */
-const char *blspec_entry_var_get(struct blspec_entry *entry, const char *name)
-{
- const char *str;
- int ret;
-
- ret = of_property_read_string(entry->node, name, &str);
-
- return ret ? NULL : str;
-}
-
static void blspec_entry_free(struct bootentry *be)
{
struct blspec_entry *entry = container_of(be, struct blspec_entry, entry);
@@ -384,8 +396,8 @@ static bool entry_is_match_machine_id(struct blspec_entry *entry)
return ret;
}
-int blspec_scan_file(struct bootentries *bootentries, const char *root,
- const char *configname)
+static int blspec_scan_file(struct bootentries *bootentries, const char *root,
+ const char *configname)
{
char *devname = NULL, *hwdevname = NULL;
struct blspec_entry *entry;
@@ -440,7 +452,7 @@ int blspec_scan_file(struct bootentries *bootentries, const char *root,
*
* returns the number of entries found or a negative error value otherwise.
*/
-int blspec_scan_directory(struct bootentries *bootentries, const char *root)
+static int blspec_scan_directory(struct bootentries *bootentries, const char *root)
{
glob_t globb;
char *abspath;
@@ -565,7 +577,7 @@ static int blspec_scan_cdev(struct bootentries *bootentries, struct cdev *cdev)
* Returns the number of entries found or a negative error code if some unexpected
* error occurred.
*/
-int blspec_scan_device(struct bootentries *bootentries, struct device *dev)
+static int blspec_scan_device(struct bootentries *bootentries, struct device *dev)
{
struct device *child;
struct cdev *cdev;
@@ -627,7 +639,7 @@ int blspec_scan_device(struct bootentries *bootentries, struct device *dev)
* Returns the number of entries found or a negative error code if some unexpected
* error occurred.
*/
-int blspec_scan_devicename(struct bootentries *bootentries, const char *devname)
+static int blspec_scan_devicename(struct bootentries *bootentries, const char *devname)
{
struct device *dev;
struct cdev *cdev;
diff --git a/include/blspec.h b/include/blspec.h
deleted file mode 100644
index cebc7a648703..000000000000
--- a/include/blspec.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __LOADER_H__
-#define __LOADER_H__
-
-#include <linux/list.h>
-#include <boot.h>
-
-struct blspec_entry {
- struct bootentry entry;
-
- struct device_node *node;
- struct cdev *cdev;
- const char *rootpath;
- const char *configpath;
-};
-
-int blspec_entry_var_set(struct blspec_entry *entry, const char *name,
- const char *val);
-const char *blspec_entry_var_get(struct blspec_entry *entry, const char *name);
-
-int blspec_scan_device(struct bootentries *bootentries, struct device *dev);
-int blspec_scan_devicename(struct bootentries *bootentries, const char *devname);
-int blspec_scan_directory(struct bootentries *bootentries, const char *root);
-int blspec_scan_file(struct bootentries *bootentries, const char *root,
- const char *configname);
-
-#endif /* __LOADER_H__ */
--
2.39.5
More information about the barebox
mailing list