s390/zcrypt: Convert to PM ops
Lars-Peter Clausen wrote on 22.11.2016 10:06:
Quoted 68 lines
drivers/s390/crypto/ap_bus.c static struct notifier_block ap_power_notifier =
Quoted 53 lines
----- Original message -----
From: Lars-Peter Clausen <[email protected]>
To: Ingo Tuchscherer/Germany/IBM@IBMDE, [email protected], [email protected]
Cc: [email protected], Lars-Peter Clausen <[email protected]>
Subject: [PATCH] s390/zcrypt: Convert to PM ops
Date: Tue, Nov 22, 2016 10:06 PMSwitch the zcrypt bus from legacy suspend/resume callbacks to
dev_pm_ops. The conversion is straight forward with the help ofSIMPLE_DEV_PM_OPS(). The newdev_pm_opsbased version is functionally equivalent to the legacy callbacks version.This will allow to eventually remove support for legacy suspend/resume callbacks from the kernel altogether.
Also remove the empty no-op resume function. There is no need to keep it around, the PM core handles the case where it is NULL just fine.
Signed-off-by Lars-Peter Clausen <[email protected]>--- drivers/s390/crypto/ap_bus.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)drivers/s390/crypto/ap_bus.c +1
-6@@ -1273,7 +1273,7 @@ static int ap_uevent (struct device *dev, struct kobj_uevent_env *env)return retval; } -static int ap_dev_suspend (struct device *dev,pm_message_t state) +static int ap_dev_suspend (struct device *dev) {struct ap_device *ap_dev =to_ap_dev (dev);@@ -1287,11 +1287,6 @@ static int ap_dev_suspend(struct device *dev, pm_message_t state)return 0 ; } -static int ap_dev_resume (struct device *dev) -{ -return 0 ; -} -static void ap_bus_suspend (void ) {ap_suspend_flag = 1;drivers/s390/crypto/ap_bus.c +0
-0@@ -1356,12 +1351,13 @@ static struct notifier_block ap_power_notifier ={
Quoted 14 lines
drivers/s390/crypto/ap_bus.c +3
-2.notifier_call = ap_power_event, }; +static SIMPLE_DEV_PM_OPS(ap_bus_pm_ops, ap_dev_suspend, NULL); +static struct bus_type ap_bus_type = { .name ="ap" , .match = &ap_bus_match, .uevent = &ap_uevent, - .suspend = ap_dev_suspend, - .resume = ap_dev_resume, + .pm = &ap_bus_pm_ops, };
Quoted 5 lines
Quoted 5 lines
drivers/s390/crypto/ap_bus.c +0
-1void ap_device_init_reply(struct ap_device *ap_dev, --2.1.4
applied with one slight adaption.
Many thanks !
Harald Freudenberger