Commit 1e89a499 authored by Corey Minyard's avatar Corey Minyard

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: default avatarCorey Minyard <cminyard@mvista.com>
parent 3fd32f9e
/*
* 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);
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#include <linux/ipmi.h> #include <linux/ipmi.h>
#include <linux/ipmi_smi.h> #include <linux/ipmi_smi.h>
#include <asm/io.h> #include <asm/io.h>
#include "ipmi_si_sm.h" #include "ipmi_si.h"
#include "ipmi_dmi.h" #include "ipmi_dmi.h"
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -332,7 +332,6 @@ static int num_max_busy_us; ...@@ -332,7 +332,6 @@ static int num_max_busy_us;
static bool unload_when_empty = true; static bool unload_when_empty = true;
static int add_smi(struct smi_info *smi);
static int try_smi_init(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_one_si(struct smi_info *to_clean);
static void cleanup_ipmi_si(void); static void cleanup_ipmi_si(void);
...@@ -1310,9 +1309,6 @@ static LIST_HEAD(smi_infos); ...@@ -1310,9 +1309,6 @@ static LIST_HEAD(smi_infos);
static DEFINE_MUTEX(smi_infos_lock); static DEFINE_MUTEX(smi_infos_lock);
static int smi_num; /* Used to sequence the SMIs */ static int smi_num; /* Used to sequence the SMIs */
#define DEFAULT_REGSPACING 1
#define DEFAULT_REGSIZE 1
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static bool si_tryacpi = true; static bool si_tryacpi = true;
#endif #endif
...@@ -1341,8 +1337,6 @@ static unsigned int num_regshifts; ...@@ -1341,8 +1337,6 @@ static unsigned int num_regshifts;
static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */ static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */
static unsigned int num_slave_addrs; 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 const char * const addr_space_to_str[] = { "i/o", "mem" };
static int hotmod_handler(const char *val, struct kernel_param *kp); 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) ...@@ -1950,7 +1944,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
info->irq_setup = std_irq_setup; info->irq_setup = std_irq_setup;
info->slave_addr = ipmb; info->slave_addr = ipmb;
rv = add_smi(info); rv = ipmi_si_add_smi(info);
if (rv) { if (rv) {
kfree(info); kfree(info);
goto out; goto out;
...@@ -2044,7 +2038,7 @@ static int hardcode_find_bmc(void) ...@@ -2044,7 +2038,7 @@ static int hardcode_find_bmc(void)
info->irq_setup = std_irq_setup; info->irq_setup = std_irq_setup;
info->slave_addr = slave_addrs[i]; info->slave_addr = slave_addrs[i];
if (!add_smi(info)) { if (!ipmi_si_add_smi(info)) {
mutex_lock(&smi_infos_lock); mutex_lock(&smi_infos_lock);
if (try_smi_init(info)) if (try_smi_init(info))
cleanup_one_si(info); cleanup_one_si(info);
...@@ -2244,7 +2238,7 @@ static int try_init_spmi(struct SPMITable *spmi) ...@@ -2244,7 +2238,7 @@ static int try_init_spmi(struct SPMITable *spmi)
info->io.addr_data, info->io.regsize, info->io.regspacing, info->io.addr_data, info->io.regsize, info->io.regspacing,
info->irq); info->irq);
rv = add_smi(info); rv = ipmi_si_add_smi(info);
if (rv) if (rv)
kfree(info); kfree(info);
...@@ -2380,7 +2374,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev) ...@@ -2380,7 +2374,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
info->io.addr_data, info->io.regsize, info->io.regspacing, info->io.addr_data, info->io.regsize, info->io.regspacing,
info->irq); info->irq);
if (add_smi(info)) if (ipmi_si_add_smi(info))
kfree(info); kfree(info);
return 0; return 0;
...@@ -2515,7 +2509,7 @@ static int ipmi_pci_probe(struct pci_dev *pdev, ...@@ -2515,7 +2509,7 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
&pdev->resource[0], info->io.regsize, info->io.regspacing, &pdev->resource[0], info->io.regsize, info->io.regspacing,
info->irq); info->irq);
rv = add_smi(info); rv = ipmi_si_add_smi(info);
if (rv) { if (rv) {
kfree(info); kfree(info);
pci_disable_device(pdev); pci_disable_device(pdev);
...@@ -2635,7 +2629,7 @@ static int of_ipmi_probe(struct platform_device *dev) ...@@ -2635,7 +2629,7 @@ static int of_ipmi_probe(struct platform_device *dev)
dev_set_drvdata(&dev->dev, info); dev_set_drvdata(&dev->dev, info);
ret = add_smi(info); ret = ipmi_si_add_smi(info);
if (ret) { if (ret) {
kfree(info); kfree(info);
return ret; return ret;
...@@ -2760,7 +2754,7 @@ static int acpi_ipmi_probe(struct platform_device *dev) ...@@ -2760,7 +2754,7 @@ static int acpi_ipmi_probe(struct platform_device *dev)
res, info->io.regsize, info->io.regspacing, res, info->io.regsize, info->io.regspacing,
info->irq); info->irq);
rv = add_smi(info); rv = ipmi_si_add_smi(info);
if (rv) if (rv)
kfree(info); kfree(info);
...@@ -2842,7 +2836,7 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev) ...@@ -2842,7 +2836,7 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev)
dev_set_drvdata(&dev->dev, info); dev_set_drvdata(&dev->dev, info);
rv = add_smi(info); rv = ipmi_si_add_smi(info);
if (rv) { if (rv) {
kfree(info); kfree(info);
return rv; return rv;
...@@ -3448,7 +3442,7 @@ static struct smi_info *find_dup_si(struct smi_info *info) ...@@ -3448,7 +3442,7 @@ static struct smi_info *find_dup_si(struct smi_info *info)
return NULL; return NULL;
} }
static int add_smi(struct smi_info *new_smi) int ipmi_si_add_smi(struct smi_info *new_smi)
{ {
int rv = 0; int rv = 0;
struct smi_info *dup; struct smi_info *dup;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment