Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151114
b: refs/heads/master
c: 9f62fa1
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Weinhuber authored and Martin Schwidefsky committed Jun 16, 2009
1 parent 4601ab0 commit b105ae7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b241f7bcc603babd3de903fa855d418ee7c4751d
refs/heads/master: 9f62fa1618987e9fadb2eef86d35ef168ddf5a1f
27 changes: 26 additions & 1 deletion trunk/drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* character device driver for reading z/VM system service records
*
*
* Copyright 2004 IBM Corporation
* Copyright IBM Corp. 2004, 2009
* character device driver for reading z/VM system service records,
* Version 1.0
* Author(s): Xenia Tkatschow <xenia@us.ibm.com>
Expand Down Expand Up @@ -660,6 +660,29 @@ static struct attribute *vmlogrdr_attrs[] = {
NULL,
};

static int vmlogrdr_pm_prepare(struct device *dev)
{
int rc;
struct vmlogrdr_priv_t *priv = dev->driver_data;

rc = 0;
if (priv) {
spin_lock_bh(&priv->priv_lock);
if (priv->dev_in_use)
rc = -EBUSY;
spin_unlock_bh(&priv->priv_lock);
}
if (rc)
pr_err("vmlogrdr: device %s is busy. Refuse to suspend.\n",
dev_name(dev));
return rc;
}


static struct dev_pm_ops vmlogrdr_pm_ops = {
.prepare = vmlogrdr_pm_prepare,
};

static struct attribute_group vmlogrdr_attr_group = {
.attrs = vmlogrdr_attrs,
};
Expand All @@ -668,6 +691,7 @@ static struct class *vmlogrdr_class;
static struct device_driver vmlogrdr_driver = {
.name = "vmlogrdr",
.bus = &iucv_bus,
.pm = &vmlogrdr_pm_ops,
};


Expand Down Expand Up @@ -729,6 +753,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
dev->bus = &iucv_bus;
dev->parent = iucv_root;
dev->driver = &vmlogrdr_driver;
dev->driver_data = priv;
/*
* The release function could be called after the
* module has been unloaded. It's _only_ task is to
Expand Down

0 comments on commit b105ae7

Please sign in to comment.