Skip to content

Commit

Permalink
ipmi_si: Rename function to add smi, make it global
Browse files Browse the repository at this point in the history
Getting ready for moving the platform-specific stuff into their
own files.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Sep 27, 2017
1 parent 3fd32f9 commit 1e89a49
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
18 changes: 18 additions & 0 deletions drivers/char/ipmi/ipmi_si.h
Original file line number Diff line number Diff line change
@@ -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);
26 changes: 10 additions & 16 deletions drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1e89a49

Please sign in to comment.