[PATCH v2 3/3] spmi: Don't export locally used function spmi_device_add()

From: Uwe Kleine-König

Date: Thu Nov 26 2026 - 09:48:49 EST


drivers/spmi/spmi.c is the only user of spmi_device_add(). So there is
no need to export this function for module usage.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
---
drivers/spmi/spmi.c | 3 +--
include/linux/spmi.h | 2 --
2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 6d6805a5ae69..c8b3e236db83 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -73,7 +73,7 @@ static int spmi_device_match(struct device *dev, const struct device_driver *drv
* spmi_device_add() - add a device previously constructed via spmi_device_alloc()
* @sdev: spmi_device to be added
*/
-int spmi_device_add(struct spmi_device *sdev)
+static int spmi_device_add(struct spmi_device *sdev)
{
struct spmi_controller *ctrl = sdev->ctrl;
int err;
@@ -89,7 +89,6 @@ int spmi_device_add(struct spmi_device *sdev)
dev_dbg(&sdev->dev, "device registered\n");
return 0;
}
-EXPORT_SYMBOL_GPL(spmi_device_add);

/**
* spmi_device_remove(): remove an SPMI device
diff --git a/include/linux/spmi.h b/include/linux/spmi.h
index 4daebc980501..c81ff3eb8cbe 100644
--- a/include/linux/spmi.h
+++ b/include/linux/spmi.h
@@ -65,8 +65,6 @@ static inline void spmi_device_put(struct spmi_device *sdev)
put_device(&sdev->dev);
}

-int spmi_device_add(struct spmi_device *sdev);
-
void spmi_device_remove(struct spmi_device *sdev);

/**
--
2.47.3