diff options
author | Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> | 2020-12-09 18:33:43 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-10 10:45:36 +0100 |
commit | d40c2d4ed62df64ce603c208bceff25245380157 (patch) | |
tree | 4950dd8a825772c2846014c620b30a7768dc55bf /drivers/spmi | |
parent | 0be0a733c9cd396c3900ac10873419d8b21bfd39 (diff) |
spmi: Add driver shutdown support
Add new shutdown() method. Use it in the standard driver model style.
Link: https://lore.kernel.org/r/1603187810-30481-2-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20201210023344.2838141-4-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/spmi')
-rw-r--r-- | drivers/spmi/spmi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c index 253340e10dab..51f5aeb65b3b 100644 --- a/drivers/spmi/spmi.c +++ b/drivers/spmi/spmi.c @@ -359,6 +359,14 @@ static int spmi_drv_remove(struct device *dev) return 0; } +static void spmi_drv_shutdown(struct device *dev) +{ + const struct spmi_driver *sdrv = to_spmi_driver(dev->driver); + + if (sdrv && sdrv->shutdown) + sdrv->shutdown(to_spmi_device(dev)); +} + static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env) { int ret; @@ -375,6 +383,7 @@ static struct bus_type spmi_bus_type = { .match = spmi_device_match, .probe = spmi_drv_probe, .remove = spmi_drv_remove, + .shutdown = spmi_drv_shutdown, .uevent = spmi_drv_uevent, }; |