提交 8283b491 编写于 作者: J Jean Delvare 提交者: Greg Kroah-Hartman

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: NJean Delvare <jdelvare@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1bb6c08a
...@@ -542,12 +542,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) ...@@ -542,12 +542,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
goto err_alloc; goto err_alloc;
} }
ret = dev_set_drvdata(dev, data); dev_set_drvdata(dev, data);
if (ret) {
dev_dbg(dev, "Unabled to initialize driver data\n");
goto err_init;
}
data->nsfrs = pdev->num_resources / 2; data->nsfrs = pdev->num_resources / 2;
data->sfrbases = kmalloc(sizeof(*data->sfrbases) * data->nsfrs, data->sfrbases = kmalloc(sizeof(*data->sfrbases) * data->nsfrs,
GFP_KERNEL); GFP_KERNEL);
......
...@@ -349,7 +349,6 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group, ...@@ -349,7 +349,6 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
void *device_data) void *device_data)
{ {
struct vfio_device *device; struct vfio_device *device;
int ret;
device = kzalloc(sizeof(*device), GFP_KERNEL); device = kzalloc(sizeof(*device), GFP_KERNEL);
if (!device) if (!device)
...@@ -360,12 +359,7 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group, ...@@ -360,12 +359,7 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
device->group = group; device->group = group;
device->ops = ops; device->ops = ops;
device->device_data = device_data; device->device_data = device_data;
dev_set_drvdata(dev, device);
ret = dev_set_drvdata(dev, device);
if (ret) {
kfree(device);
return ERR_PTR(ret);
}
/* No need to get group_lock, caller has group reference */ /* No need to get group_lock, caller has group reference */
vfio_group_get(group); vfio_group_get(group);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册