driver core: dev_set_drvdata can no longer fail
authorJean Delvare <jdelvare@suse.de>
Mon, 14 Apr 2014 10:55:38 +0000 (12:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 20:40:51 +0000 (13:40 -0700)
So there is no point in checking its return value, which will soon
disappear.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/exynos-iommu.c
drivers/vfio/vfio.c

index 074018979cdfb047f96619bf050b0f26ba5a623f..b97a6ab95a9ddfd63a87808dfb98b040a346431d 100644 (file)
@@ -542,12 +542,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
                goto err_alloc;
        }
 
-       ret = dev_set_drvdata(dev, data);
-       if (ret) {
-               dev_dbg(dev, "Unabled to initialize driver data\n");
-               goto err_init;
-       }
-
+       dev_set_drvdata(dev, data);
        data->nsfrs = pdev->num_resources / 2;
        data->sfrbases = kmalloc(sizeof(*data->sfrbases) * data->nsfrs,
                                                                GFP_KERNEL);
index 512f479d8a50af5eb95c2717bb9a225b9a4e6bfa..f018d8d0f975360a091339699d12348c5c93a12b 100644 (file)
@@ -349,7 +349,6 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
                                             void *device_data)
 {
        struct vfio_device *device;
-       int ret;
 
        device = kzalloc(sizeof(*device), GFP_KERNEL);
        if (!device)
@@ -360,12 +359,7 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
        device->group = group;
        device->ops = ops;
        device->device_data = device_data;
-
-       ret = dev_set_drvdata(dev, device);
-       if (ret) {
-               kfree(device);
-               return ERR_PTR(ret);
-       }
+       dev_set_drvdata(dev, device);
 
        /* No need to get group_lock, caller has group reference */
        vfio_group_get(group);