mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
For Linux v5.14, the function device_add_disk() has a void return type
and compilation now fails with ...
nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:1162:8:
error: invalid use of void expression
1162 | (void)!device_add_disk(vblkdev->device, vblkdev->gd, NULL);
| ^
Fix the build for kernels prior to v5.15 by not attempting to access
the return value. Finally, for kernels v5.15 and newer, do not ignore
the return value and report an error if device_add_disk() fails.
Bug 4052299
Change-Id: I975f30bc67661eacf74634b5edb70e5ad5fc1a8d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2881453
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>