diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-02-28 06:07:38 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-03-07 03:52:21 -0500 |
commit | 93481c90200c50c7874b6a773acc87095ee3907d (patch) | |
tree | 1cc69d08a0a545e46c8c38fae62bf9dee06a2a86 | |
parent | 8360cb5f389ebd36b708978e0f776a285a2deb5a (diff) |
s390/scm_drv: extend notify callback
Extend the notify callback of scm_driver by an event parameter
to allow to distinguish between different notifications.
Reviewed-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/eadm.h | 4 | ||||
-rw-r--r-- | drivers/s390/block/scm_drv.c | 16 | ||||
-rw-r--r-- | drivers/s390/cio/scm.c | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h index 8d4847191ecc..a4a1ea49003e 100644 --- a/arch/s390/include/asm/eadm.h +++ b/arch/s390/include/asm/eadm.h | |||
@@ -96,11 +96,13 @@ struct scm_device { | |||
96 | #define OP_STATE_TEMP_ERR 2 | 96 | #define OP_STATE_TEMP_ERR 2 |
97 | #define OP_STATE_PERM_ERR 3 | 97 | #define OP_STATE_PERM_ERR 3 |
98 | 98 | ||
99 | enum scm_event {SCM_CHANGE}; | ||
100 | |||
99 | struct scm_driver { | 101 | struct scm_driver { |
100 | struct device_driver drv; | 102 | struct device_driver drv; |
101 | int (*probe) (struct scm_device *scmdev); | 103 | int (*probe) (struct scm_device *scmdev); |
102 | int (*remove) (struct scm_device *scmdev); | 104 | int (*remove) (struct scm_device *scmdev); |
103 | void (*notify) (struct scm_device *scmdev); | 105 | void (*notify) (struct scm_device *scmdev, enum scm_event event); |
104 | void (*handler) (struct scm_device *scmdev, void *data, int error); | 106 | void (*handler) (struct scm_device *scmdev, void *data, int error); |
105 | }; | 107 | }; |
106 | 108 | ||
diff --git a/drivers/s390/block/scm_drv.c b/drivers/s390/block/scm_drv.c index 9fa0a908607b..ff8558c4fe25 100644 --- a/drivers/s390/block/scm_drv.c +++ b/drivers/s390/block/scm_drv.c | |||
@@ -13,12 +13,16 @@ | |||
13 | #include <asm/eadm.h> | 13 | #include <asm/eadm.h> |
14 | #include "scm_blk.h" | 14 | #include "scm_blk.h" |
15 | 15 | ||
16 | static void notify(struct scm_device *scmdev) | 16 | static void scm_notify(struct scm_device *scmdev, enum scm_event event) |
17 | { | 17 | { |
18 | pr_info("%lu: The capabilities of the SCM increment changed\n", | 18 | switch (event) { |
19 | (unsigned long) scmdev->address); | 19 | case SCM_CHANGE: |
20 | SCM_LOG(2, "State changed"); | 20 | pr_info("%lu: The capabilities of the SCM increment changed\n", |
21 | SCM_LOG_STATE(2, scmdev); | 21 | (unsigned long) scmdev->address); |
22 | SCM_LOG(2, "State changed"); | ||
23 | SCM_LOG_STATE(2, scmdev); | ||
24 | break; | ||
25 | } | ||
22 | } | 26 | } |
23 | 27 | ||
24 | static int scm_probe(struct scm_device *scmdev) | 28 | static int scm_probe(struct scm_device *scmdev) |
@@ -64,7 +68,7 @@ static struct scm_driver scm_drv = { | |||
64 | .name = "scm_block", | 68 | .name = "scm_block", |
65 | .owner = THIS_MODULE, | 69 | .owner = THIS_MODULE, |
66 | }, | 70 | }, |
67 | .notify = notify, | 71 | .notify = scm_notify, |
68 | .probe = scm_probe, | 72 | .probe = scm_probe, |
69 | .remove = scm_remove, | 73 | .remove = scm_remove, |
70 | .handler = scm_blk_irq, | 74 | .handler = scm_blk_irq, |
diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c index bcf20f3aa51b..31ac26499979 100644 --- a/drivers/s390/cio/scm.c +++ b/drivers/s390/cio/scm.c | |||
@@ -211,7 +211,7 @@ static void scmdev_update(struct scm_device *scmdev, struct sale *sale) | |||
211 | goto out; | 211 | goto out; |
212 | scmdrv = to_scm_drv(scmdev->dev.driver); | 212 | scmdrv = to_scm_drv(scmdev->dev.driver); |
213 | if (changed && scmdrv->notify) | 213 | if (changed && scmdrv->notify) |
214 | scmdrv->notify(scmdev); | 214 | scmdrv->notify(scmdev, SCM_CHANGE); |
215 | out: | 215 | out: |
216 | device_unlock(&scmdev->dev); | 216 | device_unlock(&scmdev->dev); |
217 | if (changed) | 217 | if (changed) |