Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93481c90 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky
Browse files

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: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 8360cb5f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -96,11 +96,13 @@ struct scm_device {
#define OP_STATE_TEMP_ERR	2
#define OP_STATE_PERM_ERR	3

enum scm_event {SCM_CHANGE};

struct scm_driver {
	struct device_driver drv;
	int (*probe) (struct scm_device *scmdev);
	int (*remove) (struct scm_device *scmdev);
	void (*notify) (struct scm_device *scmdev);
	void (*notify) (struct scm_device *scmdev, enum scm_event event);
	void (*handler) (struct scm_device *scmdev, void *data, int error);
};

+10 −6
Original line number Diff line number Diff line
@@ -13,12 +13,16 @@
#include <asm/eadm.h>
#include "scm_blk.h"

static void notify(struct scm_device *scmdev)
static void scm_notify(struct scm_device *scmdev, enum scm_event event)
{
	switch (event) {
	case SCM_CHANGE:
		pr_info("%lu: The capabilities of the SCM increment changed\n",
			(unsigned long) scmdev->address);
		SCM_LOG(2, "State changed");
		SCM_LOG_STATE(2, scmdev);
		break;
	}
}

static int scm_probe(struct scm_device *scmdev)
@@ -64,7 +68,7 @@ static struct scm_driver scm_drv = {
		.name = "scm_block",
		.owner = THIS_MODULE,
	},
	.notify = notify,
	.notify = scm_notify,
	.probe = scm_probe,
	.remove = scm_remove,
	.handler = scm_blk_irq,
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ static void scmdev_update(struct scm_device *scmdev, struct sale *sale)
		goto out;
	scmdrv = to_scm_drv(scmdev->dev.driver);
	if (changed && scmdrv->notify)
		scmdrv->notify(scmdev);
		scmdrv->notify(scmdev, SCM_CHANGE);
out:
	device_unlock(&scmdev->dev);
	if (changed)