diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-05 23:58:04 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-05 23:58:04 +0300 |
commit | 1f2dc7f5b6c1fffdb24e776b9d3529bd9414aa2c (patch) | |
tree | 529b1909ef2ecc96a1370eac4251479a9230e853 /drivers/char/ipmi/bt-bmc.c | |
parent | 5a36f0f3f518c60ccddf052e6c48862f357d126f (diff) | |
parent | 2a556ce779e39b15cbb74e896ca640e86baeb1a1 (diff) | |
download | linux-1f2dc7f5b6c1fffdb24e776b9d3529bd9414aa2c.tar.xz |
Merge tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi
Pull IPMI updates from Corey Minyard:
"A few small fixes for things, nothing earth shattering"
* tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi:
ipmi:ssif: Remove dynamic platform device handing
Try to load acpi_ipmi when an SSIF ACPI IPMI interface is added
ipmi_si: Load acpi_ipmi when ACPI IPMI interface added
ipmi:bt-bmc: Fix error handling and status check
ipmi: Replace guid_copy() with import_guid() where it makes sense
ipmi: use vzalloc instead of kmalloc for user creation
ipmi:bt-bmc: Fix some format issue of the code
ipmi:bt-bmc: Avoid unnecessary check
Diffstat (limited to 'drivers/char/ipmi/bt-bmc.c')
-rw-r--r-- | drivers/char/ipmi/bt-bmc.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c index d36aeacb290e..a395e2e70dc5 100644 --- a/drivers/char/ipmi/bt-bmc.c +++ b/drivers/char/ipmi/bt-bmc.c @@ -399,15 +399,15 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc, struct device *dev = &pdev->dev; int rc; - bt_bmc->irq = platform_get_irq(pdev, 0); - if (!bt_bmc->irq) - return -ENODEV; + bt_bmc->irq = platform_get_irq_optional(pdev, 0); + if (bt_bmc->irq < 0) + return bt_bmc->irq; rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED, DEVICE_NAME, bt_bmc); if (rc < 0) { dev_warn(dev, "Unable to request IRQ %d\n", bt_bmc->irq); - bt_bmc->irq = 0; + bt_bmc->irq = rc; return rc; } @@ -430,9 +430,6 @@ static int bt_bmc_probe(struct platform_device *pdev) struct device *dev; int rc; - if (!pdev || !pdev->dev.of_node) - return -ENODEV; - dev = &pdev->dev; dev_info(dev, "Found bt bmc device\n"); @@ -466,9 +463,9 @@ static int bt_bmc_probe(struct platform_device *pdev) init_waitqueue_head(&bt_bmc->queue); bt_bmc->miscdev.minor = MISC_DYNAMIC_MINOR, - bt_bmc->miscdev.name = DEVICE_NAME, - bt_bmc->miscdev.fops = &bt_bmc_fops, - bt_bmc->miscdev.parent = dev; + bt_bmc->miscdev.name = DEVICE_NAME, + bt_bmc->miscdev.fops = &bt_bmc_fops, + bt_bmc->miscdev.parent = dev; rc = misc_register(&bt_bmc->miscdev); if (rc) { dev_err(dev, "Unable to register misc device\n"); @@ -477,7 +474,7 @@ static int bt_bmc_probe(struct platform_device *pdev) bt_bmc_config_irq(bt_bmc, pdev); - if (bt_bmc->irq) { + if (bt_bmc->irq >= 0) { dev_info(dev, "Using IRQ %d\n", bt_bmc->irq); } else { dev_info(dev, "No IRQ; using timer\n"); @@ -503,7 +500,7 @@ static int bt_bmc_remove(struct platform_device *pdev) struct bt_bmc *bt_bmc = dev_get_drvdata(&pdev->dev); misc_deregister(&bt_bmc->miscdev); - if (!bt_bmc->irq) + if (bt_bmc->irq < 0) del_timer_sync(&bt_bmc->poll_timer); return 0; } |