Skip to content

Commit f5e728a

Browse files
Saurabh Sengarliuw
authored andcommitted
fbdev: hyperv_fb: Simplify hvfb_putmem
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>
1 parent 3043863 commit f5e728a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/video/fbdev/hyperv_fb.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,15 +952,15 @@ static phys_addr_t hvfb_get_phymem(struct hv_device *hdev,
952952
}
953953

954954
/* Release contiguous physical memory */
955-
static void hvfb_release_phymem(struct hv_device *hdev,
955+
static void hvfb_release_phymem(struct device *device,
956956
phys_addr_t paddr, unsigned int size)
957957
{
958958
unsigned int order = get_order(size);
959959

960960
if (order <= MAX_PAGE_ORDER)
961961
__free_pages(pfn_to_page(paddr >> PAGE_SHIFT), order);
962962
else
963-
dma_free_coherent(&hdev->device,
963+
dma_free_coherent(device,
964964
round_up(size, PAGE_SIZE),
965965
phys_to_virt(paddr),
966966
paddr);
@@ -1080,7 +1080,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
10801080
}
10811081

10821082
/* Release the framebuffer */
1083-
static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)
1083+
static void hvfb_putmem(struct fb_info *info)
10841084
{
10851085
struct hvfb_par *par = info->par;
10861086

@@ -1089,7 +1089,7 @@ static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)
10891089
iounmap(par->mmio_vp);
10901090
vmbus_free_mmio(par->mem->start, screen_fb_size);
10911091
} else {
1092-
hvfb_release_phymem(hdev, info->fix.smem_start,
1092+
hvfb_release_phymem(info->device, info->fix.smem_start,
10931093
screen_fb_size);
10941094
}
10951095

@@ -1203,7 +1203,7 @@ static int hvfb_probe(struct hv_device *hdev,
12031203

12041204
error:
12051205
fb_deferred_io_cleanup(info);
1206-
hvfb_putmem(hdev, info);
1206+
hvfb_putmem(info);
12071207
error2:
12081208
vmbus_close(hdev->channel);
12091209
error1:
@@ -1232,7 +1232,7 @@ static void hvfb_remove(struct hv_device *hdev)
12321232
vmbus_close(hdev->channel);
12331233
hv_set_drvdata(hdev, NULL);
12341234

1235-
hvfb_putmem(hdev, info);
1235+
hvfb_putmem(info);
12361236
framebuffer_release(info);
12371237
}
12381238

0 commit comments

Comments
 (0)