diff options
author | Corey Minyard <cminyard@mvista.com> | 2014-10-10 23:11:05 -0400 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2014-12-11 16:04:05 -0500 |
commit | 5a0e10ec4a82ec9e1ab9b85a0f2c2893f7ffda25 (patch) | |
tree | b4846f66af4bd76d91ecda78b0f8cb6c4edc303d /drivers/char | |
parent | 16639eb08a6947bef8f4d78e22b6010ba4c3cb90 (diff) |
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: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 34 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 1 |
2 files changed, 5 insertions, 30 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 4539afa5b7f2..5b08b92c6441 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -342,7 +342,6 @@ struct ipmi_smi { | |||
342 | 342 | ||
343 | struct bmc_device *bmc; | 343 | struct bmc_device *bmc; |
344 | char *my_dev_name; | 344 | char *my_dev_name; |
345 | char *sysfs_name; | ||
346 | 345 | ||
347 | /* | 346 | /* |
348 | * This is the lower-layer's sender routine. Note that you | 347 | * 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 | { | 2372 | { |
2374 | struct bmc_device *bmc = intf->bmc; | 2373 | struct bmc_device *bmc = intf->bmc; |
2375 | 2374 | ||
2376 | if (intf->sysfs_name) { | 2375 | sysfs_remove_link(&intf->si_dev->kobj, "bmc"); |
2377 | sysfs_remove_link(&intf->si_dev->kobj, intf->sysfs_name); | ||
2378 | kfree(intf->sysfs_name); | ||
2379 | intf->sysfs_name = NULL; | ||
2380 | } | ||
2381 | if (intf->my_dev_name) { | 2376 | if (intf->my_dev_name) { |
2382 | sysfs_remove_link(&bmc->pdev.dev.kobj, intf->my_dev_name); | 2377 | sysfs_remove_link(&bmc->pdev.dev.kobj, intf->my_dev_name); |
2383 | kfree(intf->my_dev_name); | 2378 | kfree(intf->my_dev_name); |
@@ -2417,8 +2412,7 @@ out: | |||
2417 | return err; | 2412 | return err; |
2418 | } | 2413 | } |
2419 | 2414 | ||
2420 | static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | 2415 | static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum) |
2421 | const char *sysfs_name) | ||
2422 | { | 2416 | { |
2423 | int rv; | 2417 | int rv; |
2424 | struct bmc_device *bmc = intf->bmc; | 2418 | struct bmc_device *bmc = intf->bmc; |
@@ -2489,6 +2483,7 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | |||
2489 | bmc->pdev.id = bmc->id.device_id; | 2483 | bmc->pdev.id = bmc->id.device_id; |
2490 | bmc->pdev.dev.release = release_bmc_device; | 2484 | bmc->pdev.dev.release = release_bmc_device; |
2491 | bmc->pdev.dev.type = &bmc_device_type; | 2485 | bmc->pdev.dev.type = &bmc_device_type; |
2486 | kref_init(&bmc->usecount); | ||
2492 | 2487 | ||
2493 | rv = platform_device_register(&bmc->pdev); | 2488 | rv = platform_device_register(&bmc->pdev); |
2494 | mutex_unlock(&ipmidriver_mutex); | 2489 | mutex_unlock(&ipmidriver_mutex); |
@@ -2505,8 +2500,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | |||
2505 | return rv; | 2500 | return rv; |
2506 | } | 2501 | } |
2507 | 2502 | ||
2508 | kref_init(&bmc->usecount); | ||
2509 | |||
2510 | rv = create_bmc_files(bmc); | 2503 | rv = create_bmc_files(bmc); |
2511 | if (rv) { | 2504 | if (rv) { |
2512 | mutex_lock(&ipmidriver_mutex); | 2505 | mutex_lock(&ipmidriver_mutex); |
@@ -2527,20 +2520,8 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | |||
2527 | * create symlink from system interface device to bmc device | 2520 | * create symlink from system interface device to bmc device |
2528 | * and back. | 2521 | * and back. |
2529 | */ | 2522 | */ |
2530 | intf->sysfs_name = kstrdup(sysfs_name, GFP_KERNEL); | 2523 | rv = sysfs_create_link(&intf->si_dev->kobj, &bmc->pdev.dev.kobj, "bmc"); |
2531 | if (!intf->sysfs_name) { | ||
2532 | rv = -ENOMEM; | ||
2533 | printk(KERN_ERR | ||
2534 | "ipmi_msghandler: allocate link to BMC: %d\n", | ||
2535 | rv); | ||
2536 | goto out_err; | ||
2537 | } | ||
2538 | |||
2539 | rv = sysfs_create_link(&intf->si_dev->kobj, | ||
2540 | &bmc->pdev.dev.kobj, intf->sysfs_name); | ||
2541 | if (rv) { | 2524 | if (rv) { |
2542 | kfree(intf->sysfs_name); | ||
2543 | intf->sysfs_name = NULL; | ||
2544 | printk(KERN_ERR | 2525 | printk(KERN_ERR |
2545 | "ipmi_msghandler: Unable to create bmc symlink: %d\n", | 2526 | "ipmi_msghandler: Unable to create bmc symlink: %d\n", |
2546 | rv); | 2527 | rv); |
@@ -2549,8 +2530,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | |||
2549 | 2530 | ||
2550 | intf->my_dev_name = kasprintf(GFP_KERNEL, "ipmi%d", ifnum); | 2531 | intf->my_dev_name = kasprintf(GFP_KERNEL, "ipmi%d", ifnum); |
2551 | if (!intf->my_dev_name) { | 2532 | if (!intf->my_dev_name) { |
2552 | kfree(intf->sysfs_name); | ||
2553 | intf->sysfs_name = NULL; | ||
2554 | rv = -ENOMEM; | 2533 | rv = -ENOMEM; |
2555 | printk(KERN_ERR | 2534 | printk(KERN_ERR |
2556 | "ipmi_msghandler: allocate link from BMC: %d\n", | 2535 | "ipmi_msghandler: allocate link from BMC: %d\n", |
@@ -2561,8 +2540,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum, | |||
2561 | rv = sysfs_create_link(&bmc->pdev.dev.kobj, &intf->si_dev->kobj, | 2540 | rv = sysfs_create_link(&bmc->pdev.dev.kobj, &intf->si_dev->kobj, |
2562 | intf->my_dev_name); | 2541 | intf->my_dev_name); |
2563 | if (rv) { | 2542 | if (rv) { |
2564 | kfree(intf->sysfs_name); | ||
2565 | intf->sysfs_name = NULL; | ||
2566 | kfree(intf->my_dev_name); | 2543 | kfree(intf->my_dev_name); |
2567 | intf->my_dev_name = NULL; | 2544 | intf->my_dev_name = NULL; |
2568 | printk(KERN_ERR | 2545 | printk(KERN_ERR |
@@ -2761,7 +2738,6 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
2761 | void *send_info, | 2738 | void *send_info, |
2762 | struct ipmi_device_id *device_id, | 2739 | struct ipmi_device_id *device_id, |
2763 | struct device *si_dev, | 2740 | struct device *si_dev, |
2764 | const char *sysfs_name, | ||
2765 | unsigned char slave_addr) | 2741 | unsigned char slave_addr) |
2766 | { | 2742 | { |
2767 | int i, j; | 2743 | int i, j; |
@@ -2895,7 +2871,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
2895 | if (rv == 0) | 2871 | if (rv == 0) |
2896 | rv = add_proc_entries(intf, i); | 2872 | rv = add_proc_entries(intf, i); |
2897 | 2873 | ||
2898 | rv = ipmi_bmc_register(intf, i, sysfs_name); | 2874 | rv = ipmi_bmc_register(intf, i); |
2899 | 2875 | ||
2900 | out: | 2876 | out: |
2901 | if (rv) { | 2877 | if (rv) { |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 337182b5c51a..f474ad8a7b8e 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -3429,7 +3429,6 @@ static int try_smi_init(struct smi_info *new_smi) | |||
3429 | new_smi, | 3429 | new_smi, |
3430 | &new_smi->device_id, | 3430 | &new_smi->device_id, |
3431 | new_smi->dev, | 3431 | new_smi->dev, |
3432 | "bmc", | ||
3433 | new_smi->slave_addr); | 3432 | new_smi->slave_addr); |
3434 | if (rv) { | 3433 | if (rv) { |
3435 | dev_err(new_smi->dev, "Unable to register device: error %d\n", | 3434 | dev_err(new_smi->dev, "Unable to register device: error %d\n", |