From eda5ce01446182e9f7fd3713948c861c93b8616e Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Wed, 5 Oct 2022 13:12:58 +0530 Subject: [PATCH] nvidia-oot: changes to fix compilation error Using this patch we are fixing below compilaiton error with stable kernel. 1. nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:936:16: error: implicit declaration of function ___alloc_disk_node_; vblkdev->gd = __alloc_disk_node(vblkdev->queue, NUMA_NO_NODE, NULL); | ^ 2. nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:1176:3: error: implicit declaration of function _blk_cleanup_queue_ [-Werror=implicit-function-declaration] 1176 | blk_cleanup_queue(vblkdev->queue); | ^~~~~~~~~~~~~~~~~ Bug 3767126 Signed-off-by: Manish Bhardwaj Change-Id: Id0df2c15c42d4dcbae95f1ef33517d096bf96d06 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2787165 Reviewed-by: Laxman Dewangan Reviewed-by: Sachin Nikam GVS: Gerrit_Virtual_Submit --- drivers/block/tegra_virt_storage/tegra_hv_vblk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c index 0d34f48b..3e10c2f0 100644 --- a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c +++ b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c @@ -932,8 +932,12 @@ static void setup_device(struct vblk_dev *vblkdev) #endif } +#if KERNEL_VERSION(5, 19, 0) >= LINUX_VERSION_CODE /* And the gendisk structure. */ vblkdev->gd = __alloc_disk_node(vblkdev->queue, NUMA_NO_NODE, NULL); +#else + vblkdev->gd = blk_mq_alloc_disk_for_queue(vblkdev->queue, NULL); +#endif if (!vblkdev->gd) { dev_err(vblkdev->device, "alloc_disk failure\n"); return; @@ -1172,8 +1176,10 @@ static int tegra_hv_vblk_remove(struct platform_device *pdev) put_disk(vblkdev->gd); } +#if KERNEL_VERSION(5, 19, 0) >= LINUX_VERSION_CODE if (vblkdev->queue) blk_cleanup_queue(vblkdev->queue); +#endif destroy_workqueue(vblkdev->wq); tegra_hv_ivc_unreserve(vblkdev->ivck);