summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2017-09-12 13:52:13 -0500
committerCorey Minyard <cminyard@mvista.com>2017-09-27 16:03:45 -0500
commit1e89a499e55f353115b1427c5bcb9f9244a20200 (patch)
tree95571cdc2f8d826740849a39d1d4cb25913cadaa /drivers/char/ipmi
parent3fd32f9ec84f57ff6d86e762012d7626a9b31124 (diff)
ipmi_si: Rename function to add smi, make it global
Getting ready for moving the platform-specific stuff into their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_si.h18
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c26
2 files changed, 28 insertions, 16 deletions
diff --git a/drivers/char/ipmi/ipmi_si.h b/drivers/char/ipmi/ipmi_si.h
new file mode 100644
index 000000000000..a4d993b1fe66
--- /dev/null
+++ b/drivers/char/ipmi/ipmi_si.h
@@ -0,0 +1,18 @@
+/*
+ * ipmi_si.h
+ *
+ * Interface from the device-specific interfaces (OF, DMI, ACPI, PCI,
+ * etc) to the base ipmi system interface code.
+ */
+
+#include "ipmi_si_sm.h"
+
+#define IPMI_IO_ADDR_SPACE 0
+#define IPMI_MEM_ADDR_SPACE 1
+
+#define DEFAULT_REGSPACING 1
+#define DEFAULT_REGSIZE 1
+
+struct smi_info;
+
+int ipmi_si_add_smi(struct smi_info *info);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 4caa793a6765..6ba70c2fc25f 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -60,7 +60,7 @@
#include <linux/ipmi.h>
#include <linux/ipmi_smi.h>
#include <asm/io.h>
-#include "ipmi_si_sm.h"
+#include "ipmi_si.h"
#include "ipmi_dmi.h"
#include <linux/dmi.h>
#include <linux/string.h>
@@ -332,7 +332,6 @@ static int num_max_busy_us;
static bool unload_when_empty = true;
-static int add_smi(struct smi_info *smi);
static int try_smi_init(struct smi_info *smi);
static void cleanup_one_si(struct smi_info *to_clean);
static void cleanup_ipmi_si(void);
@@ -1310,9 +1309,6 @@ static LIST_HEAD(smi_infos);
static DEFINE_MUTEX(smi_infos_lock);
static int smi_num; /* Used to sequence the SMIs */
-#define DEFAULT_REGSPACING 1
-#define DEFAULT_REGSIZE 1
-
#ifdef CONFIG_ACPI
static bool si_tryacpi = true;
#endif
@@ -1341,8 +1337,6 @@ static unsigned int num_regshifts;
static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */
static unsigned int num_slave_addrs;
-#define IPMI_IO_ADDR_SPACE 0
-#define IPMI_MEM_ADDR_SPACE 1
static const char * const addr_space_to_str[] = { "i/o", "mem" };
static int hotmod_handler(const char *val, struct kernel_param *kp);
@@ -1950,7 +1944,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
info->irq_setup = std_irq_setup;
info->slave_addr = ipmb;
- rv = add_smi(info);
+ rv = ipmi_si_add_smi(info);
if (rv) {
kfree(info);
goto out;
@@ -2044,7 +2038,7 @@ static int hardcode_find_bmc(void)
info->irq_setup = std_irq_setup;
info->slave_addr = slave_addrs[i];
- if (!add_smi(info)) {
+ if (!ipmi_si_add_smi(info)) {
mutex_lock(&smi_infos_lock);
if (try_smi_init(info))
cleanup_one_si(info);
@@ -2244,7 +2238,7 @@ static int try_init_spmi(struct SPMITable *spmi)
info->io.addr_data, info->io.regsize, info->io.regspacing,
info->irq);
- rv = add_smi(info);
+ rv = ipmi_si_add_smi(info);
if (rv)
kfree(info);
@@ -2380,7 +2374,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
info->io.addr_data, info->io.regsize, info->io.regspacing,
info->irq);
- if (add_smi(info))
+ if (ipmi_si_add_smi(info))
kfree(info);
return 0;
@@ -2515,7 +2509,7 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
&pdev->resource[0], info->io.regsize, info->io.regspacing,
info->irq);
- rv = add_smi(info);
+ rv = ipmi_si_add_smi(info);
if (rv) {
kfree(info);
pci_disable_device(pdev);
@@ -2635,7 +2629,7 @@ static int of_ipmi_probe(struct platform_device *dev)
dev_set_drvdata(&dev->dev, info);
- ret = add_smi(info);
+ ret = ipmi_si_add_smi(info);
if (ret) {
kfree(info);
return ret;
@@ -2760,7 +2754,7 @@ static int acpi_ipmi_probe(struct platform_device *dev)
res, info->io.regsize, info->io.regspacing,
info->irq);
- rv = add_smi(info);
+ rv = ipmi_si_add_smi(info);
if (rv)
kfree(info);
@@ -2842,7 +2836,7 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev)
dev_set_drvdata(&dev->dev, info);
- rv = add_smi(info);
+ rv = ipmi_si_add_smi(info);
if (rv) {
kfree(info);
return rv;
@@ -3448,7 +3442,7 @@ static struct smi_info *find_dup_si(struct smi_info *info)
return NULL;
}
-static int add_smi(struct smi_info *new_smi)
+int ipmi_si_add_smi(struct smi_info *new_smi)
{
int rv = 0;
struct smi_info *dup;