summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_si_platform.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-13 15:07:02 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-13 15:07:02 -0700
commit92adeb616c9172dea9678f53ea6e5501fc4f4338 (patch)
tree7df0079de88ac11852908588b7c3551fd0c4f35f /drivers/char/ipmi/ipmi_si_platform.c
parent43c95d3694cc448fdf50bd53b7ff3a5bb4655883 (diff)
parentac499fba98c3c65078fd84fa0a62cd6f6d5837ed (diff)
Merge tag 'for-linus-5.3' of git://github.com/cminyard/linux-ipmi
Pull IPMI updates from Corey Minyard: "Some small fixes for various things, nothing huge, mostly found by automated tools. Plus add a driver that allows Linux to act as an IPMB slave device, so it can be a satellite MC in an IPMI network" * tag 'for-linus-5.3' of git://github.com/cminyard/linux-ipmi: docs: ipmb: place it at driver-api and convert to ReST fix platform_no_drv_owner.cocci warnings ipmi: ipmb: don't allocate i2c_client on stack ipmi: ipmb: Fix build error while CONFIG_I2C is set to m Add support for IPMB driver drivers: ipmi: Drop device reference ipmi_ssif: fix unexpected driver unregister warning ipmi_si: use bool type for initialized variable ipmi_si: fix unexpected driver unregister warning
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_platform.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_platform.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
index fd94c4238449..22f6c9b20e9a 100644
--- a/drivers/char/ipmi/ipmi_si_platform.c
+++ b/drivers/char/ipmi/ipmi_si_platform.c
@@ -19,6 +19,7 @@
#include "ipmi_si.h"
#include "ipmi_dmi.h"
+static bool platform_registered;
static bool si_tryplatform = true;
#ifdef CONFIG_ACPI
static bool si_tryacpi = true;
@@ -443,6 +444,7 @@ void ipmi_remove_platform_device_by_name(char *name)
struct platform_device *pdev = to_platform_device(dev);
platform_device_unregister(pdev);
+ put_device(dev);
}
}
@@ -469,9 +471,12 @@ void ipmi_si_platform_init(void)
int rv = platform_driver_register(&ipmi_platform_driver);
if (rv)
pr_err("Unable to register driver: %d\n", rv);
+ else
+ platform_registered = true;
}
void ipmi_si_platform_shutdown(void)
{
- platform_driver_unregister(&ipmi_platform_driver);
+ if (platform_registered)
+ platform_driver_unregister(&ipmi_platform_driver);
}