]> www.infradead.org Git - users/hch/misc.git/commitdiff
fbdev: hyperv_fb: Simplify hvfb_putmem
authorSaurabh Sengar <ssengar@linux.microsoft.com>
Sat, 1 Mar 2025 16:16:30 +0000 (08:16 -0800)
committerWei Liu <wei.liu@kernel.org>
Sun, 9 Mar 2025 23:56:29 +0000 (23:56 +0000)
The device object required in 'hvfb_release_phymem' function
for 'dma_free_coherent' can also be obtained from the 'info'
pointer, making 'hdev' parameter in 'hvfb_putmem' redundant.
Remove the unnecessary 'hdev' argument from 'hvfb_putmem'.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1740845791-19977-2-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1740845791-19977-2-git-send-email-ssengar@linux.microsoft.com>

drivers/video/fbdev/hyperv_fb.c

index ce23d0ef5702ae1e9c11185f037dcc51cf33dfeb..9798a34ac571fcc74f064f2274bc65ce1a11973d 100644 (file)
@@ -952,7 +952,7 @@ static phys_addr_t hvfb_get_phymem(struct hv_device *hdev,
 }
 
 /* Release contiguous physical memory */
-static void hvfb_release_phymem(struct hv_device *hdev,
+static void hvfb_release_phymem(struct device *device,
                                phys_addr_t paddr, unsigned int size)
 {
        unsigned int order = get_order(size);
@@ -960,7 +960,7 @@ static void hvfb_release_phymem(struct hv_device *hdev,
        if (order <= MAX_PAGE_ORDER)
                __free_pages(pfn_to_page(paddr >> PAGE_SHIFT), order);
        else
-               dma_free_coherent(&hdev->device,
+               dma_free_coherent(device,
                                  round_up(size, PAGE_SIZE),
                                  phys_to_virt(paddr),
                                  paddr);
@@ -1080,7 +1080,7 @@ err1:
 }
 
 /* Release the framebuffer */
-static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)
+static void hvfb_putmem(struct fb_info *info)
 {
        struct hvfb_par *par = info->par;
 
@@ -1089,7 +1089,7 @@ static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)
                iounmap(par->mmio_vp);
                vmbus_free_mmio(par->mem->start, screen_fb_size);
        } else {
-               hvfb_release_phymem(hdev, info->fix.smem_start,
+               hvfb_release_phymem(info->device, info->fix.smem_start,
                                    screen_fb_size);
        }
 
@@ -1203,7 +1203,7 @@ static int hvfb_probe(struct hv_device *hdev,
 
 error:
        fb_deferred_io_cleanup(info);
-       hvfb_putmem(hdev, info);
+       hvfb_putmem(info);
 error2:
        vmbus_close(hdev->channel);
 error1:
@@ -1232,7 +1232,7 @@ static void hvfb_remove(struct hv_device *hdev)
        vmbus_close(hdev->channel);
        hv_set_drvdata(hdev, NULL);
 
-       hvfb_putmem(hdev, info);
+       hvfb_putmem(info);
        framebuffer_release(info);
 }