Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313857
b: refs/heads/master
c: 76e0377
h: refs/heads/master
i:
  313855: f842579
v: v3
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Jun 5, 2012
1 parent d80270c commit a9871fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: 8d4ecfcb6bd19c562e60f80f13cf222db5b4a073
refs/heads/master: 76e0377b2450af577077c7e4e00ae6da738d1884
19 changes: 8 additions & 11 deletions trunk/drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,13 @@ static struct attribute *vmlogrdr_attrs[] = {
&dev_attr_recording.attr,
NULL,
};
static struct attribute_group vmlogrdr_attr_group = {
.attrs = vmlogrdr_attrs,
};
static const struct attribute_group *vmlogrdr_attr_groups[] = {
&vmlogrdr_attr_group,
NULL,
};

static int vmlogrdr_pm_prepare(struct device *dev)
{
Expand All @@ -692,10 +699,6 @@ static const struct dev_pm_ops vmlogrdr_pm_ops = {
.prepare = vmlogrdr_pm_prepare,
};

static struct attribute_group vmlogrdr_attr_group = {
.attrs = vmlogrdr_attrs,
};

static struct class *vmlogrdr_class;
static struct device_driver vmlogrdr_driver = {
.name = "vmlogrdr",
Expand Down Expand Up @@ -762,6 +765,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
dev->bus = &iucv_bus;
dev->parent = iucv_root;
dev->driver = &vmlogrdr_driver;
dev->groups = vmlogrdr_attr_groups;
dev_set_drvdata(dev, priv);
/*
* The release function could be called after the
Expand All @@ -779,19 +783,13 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
return ret;
}

ret = sysfs_create_group(&dev->kobj, &vmlogrdr_attr_group);
if (ret) {
device_unregister(dev);
return ret;
}
priv->class_device = device_create(vmlogrdr_class, dev,
MKDEV(vmlogrdr_major,
priv->minor_num),
priv, "%s", dev_name(dev));
if (IS_ERR(priv->class_device)) {
ret = PTR_ERR(priv->class_device);
priv->class_device=NULL;
sysfs_remove_group(&dev->kobj, &vmlogrdr_attr_group);
device_unregister(dev);
return ret;
}
Expand All @@ -804,7 +802,6 @@ static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv)
{
device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num));
if (priv->device != NULL) {
sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group);
device_unregister(priv->device);
priv->device=NULL;
}
Expand Down

0 comments on commit a9871fd

Please sign in to comment.