From 8283b4919e00fb110ac338d6b9984ca92d5030fa Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 14 Apr 2014 12:55:38 +0200 Subject: [PATCH] driver core: dev_set_drvdata can no longer fail So there is no point in checking its return value, which will soon disappear. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/exynos-iommu.c | 7 +------ drivers/vfio/vfio.c | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 074018979cdf..b97a6ab95a9d 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -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); diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 512f479d8a50..f018d8d0f975 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -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); -- 2.20.1