]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/s390/char/vmlogrdr.c
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / s390 / char / vmlogrdr.c
index 411cfa3c77196261c126b79356563505b8bb901e..d1a142fa3eb46c000fe00654aa43a1c5253102f3 100644 (file)
@@ -663,7 +663,7 @@ static struct attribute *vmlogrdr_attrs[] = {
 static int vmlogrdr_pm_prepare(struct device *dev)
 {
        int rc;
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
 
        rc = 0;
        if (priv) {
@@ -753,7 +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;
+               dev_set_drvdata(dev, priv);
                /*
                 * The release function could be called after the
                 * module has been unloaded. It's _only_ task is to
@@ -765,8 +765,10 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
        } else
                return -ENOMEM;
        ret = device_register(dev);
-       if (ret)
+       if (ret) {
+               put_device(dev);
                return ret;
+       }
 
        ret = sysfs_create_group(&dev->kobj, &vmlogrdr_attr_group);
        if (ret) {