Commit 5a0e10ec authored by Corey Minyard's avatar Corey Minyard

ipmi: Remove useless sysfs_name parameters

It was always "bmc", so just hardcode it.  It makes no sense to
pass that in.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent 16639eb0
...@@ -342,7 +342,6 @@ struct ipmi_smi { ...@@ -342,7 +342,6 @@ struct ipmi_smi {
struct bmc_device *bmc; struct bmc_device *bmc;
char *my_dev_name; char *my_dev_name;
char *sysfs_name;
/* /*
* This is the lower-layer's sender routine. Note that you * This is the lower-layer's sender routine. Note that you
...@@ -2373,11 +2372,7 @@ static void ipmi_bmc_unregister(ipmi_smi_t intf) ...@@ -2373,11 +2372,7 @@ static void ipmi_bmc_unregister(ipmi_smi_t intf)
{ {
struct bmc_device *bmc = intf->bmc; struct bmc_device *bmc = intf->bmc;
if (intf->sysfs_name) { sysfs_remove_link(&intf->si_dev->kobj, "bmc");
sysfs_remove_link(&intf->si_dev->kobj, intf->sysfs_name);
kfree(intf->sysfs_name);
intf->sysfs_name = NULL;
}
if (intf->my_dev_name) { if (intf->my_dev_name) {
sysfs_remove_link(&bmc->pdev.dev.kobj, intf->my_dev_name); sysfs_remove_link(&bmc->pdev.dev.kobj, intf->my_dev_name);
kfree(intf->my_dev_name); kfree(intf->my_dev_name);
...@@ -2417,8 +2412,7 @@ static int create_bmc_files(struct bmc_device *bmc) ...@@ -2417,8 +2412,7 @@ static int create_bmc_files(struct bmc_device *bmc)
return err; return err;
} }
static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum)
const char *sysfs_name)
{ {
int rv; int rv;
struct bmc_device *bmc = intf->bmc; struct bmc_device *bmc = intf->bmc;
...@@ -2489,6 +2483,7 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, ...@@ -2489,6 +2483,7 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
bmc->pdev.id = bmc->id.device_id; bmc->pdev.id = bmc->id.device_id;
bmc->pdev.dev.release = release_bmc_device; bmc->pdev.dev.release = release_bmc_device;
bmc->pdev.dev.type = &bmc_device_type; bmc->pdev.dev.type = &bmc_device_type;
kref_init(&bmc->usecount);
rv = platform_device_register(&bmc->pdev); rv = platform_device_register(&bmc->pdev);
mutex_unlock(&ipmidriver_mutex); mutex_unlock(&ipmidriver_mutex);
...@@ -2505,8 +2500,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, ...@@ -2505,8 +2500,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
return rv; return rv;
} }
kref_init(&bmc->usecount);
rv = create_bmc_files(bmc); rv = create_bmc_files(bmc);
if (rv) { if (rv) {
mutex_lock(&ipmidriver_mutex); mutex_lock(&ipmidriver_mutex);
...@@ -2527,20 +2520,8 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, ...@@ -2527,20 +2520,8 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
* create symlink from system interface device to bmc device * create symlink from system interface device to bmc device
* and back. * and back.
*/ */
intf->sysfs_name = kstrdup(sysfs_name, GFP_KERNEL); rv = sysfs_create_link(&intf->si_dev->kobj, &bmc->pdev.dev.kobj, "bmc");
if (!intf->sysfs_name) {
rv = -ENOMEM;
printk(KERN_ERR
"ipmi_msghandler: allocate link to BMC: %d\n",
rv);
goto out_err;
}
rv = sysfs_create_link(&intf->si_dev->kobj,
&bmc->pdev.dev.kobj, intf->sysfs_name);
if (rv) { if (rv) {
kfree(intf->sysfs_name);
intf->sysfs_name = NULL;
printk(KERN_ERR printk(KERN_ERR
"ipmi_msghandler: Unable to create bmc symlink: %d\n", "ipmi_msghandler: Unable to create bmc symlink: %d\n",
rv); rv);
...@@ -2549,8 +2530,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, ...@@ -2549,8 +2530,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
intf->my_dev_name = kasprintf(GFP_KERNEL, "ipmi%d", ifnum); intf->my_dev_name = kasprintf(GFP_KERNEL, "ipmi%d", ifnum);
if (!intf->my_dev_name) { if (!intf->my_dev_name) {
kfree(intf->sysfs_name);
intf->sysfs_name = NULL;
rv = -ENOMEM; rv = -ENOMEM;
printk(KERN_ERR printk(KERN_ERR
"ipmi_msghandler: allocate link from BMC: %d\n", "ipmi_msghandler: allocate link from BMC: %d\n",
...@@ -2561,8 +2540,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, ...@@ -2561,8 +2540,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
rv = sysfs_create_link(&bmc->pdev.dev.kobj, &intf->si_dev->kobj, rv = sysfs_create_link(&bmc->pdev.dev.kobj, &intf->si_dev->kobj,
intf->my_dev_name); intf->my_dev_name);
if (rv) { if (rv) {
kfree(intf->sysfs_name);
intf->sysfs_name = NULL;
kfree(intf->my_dev_name); kfree(intf->my_dev_name);
intf->my_dev_name = NULL; intf->my_dev_name = NULL;
printk(KERN_ERR printk(KERN_ERR
...@@ -2761,7 +2738,6 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, ...@@ -2761,7 +2738,6 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
void *send_info, void *send_info,
struct ipmi_device_id *device_id, struct ipmi_device_id *device_id,
struct device *si_dev, struct device *si_dev,
const char *sysfs_name,
unsigned char slave_addr) unsigned char slave_addr)
{ {
int i, j; int i, j;
...@@ -2895,7 +2871,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, ...@@ -2895,7 +2871,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
if (rv == 0) if (rv == 0)
rv = add_proc_entries(intf, i); rv = add_proc_entries(intf, i);
rv = ipmi_bmc_register(intf, i, sysfs_name); rv = ipmi_bmc_register(intf, i);
out: out:
if (rv) { if (rv) {
......
...@@ -3429,7 +3429,6 @@ static int try_smi_init(struct smi_info *new_smi) ...@@ -3429,7 +3429,6 @@ static int try_smi_init(struct smi_info *new_smi)
new_smi, new_smi,
&new_smi->device_id, &new_smi->device_id,
new_smi->dev, new_smi->dev,
"bmc",
new_smi->slave_addr); new_smi->slave_addr);
if (rv) { if (rv) {
dev_err(new_smi->dev, "Unable to register device: error %d\n", dev_err(new_smi->dev, "Unable to register device: error %d\n",
......
...@@ -212,7 +212,6 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, ...@@ -212,7 +212,6 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
void *send_info, void *send_info,
struct ipmi_device_id *device_id, struct ipmi_device_id *device_id,
struct device *dev, struct device *dev,
const char *sysfs_name,
unsigned char slave_addr); unsigned char slave_addr);
/* /*
......
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