From d1c0a7d209f993897ee15427c5e63d59bfbec814 Mon Sep 17 00:00:00 2001 From: Denis Orlov Date: Thu, 11 May 2023 15:47:43 +0300 Subject: video: bochs: fix IOMEM usage For the PCI version of the driver, we end up calling IOMEM() twice on both the fb_map and mmio pointers. This happens because we first use pci_iomap() on PCI resources in the bochs_pci_probe() and then explicitly call IOMEM() in the bochs_hw_probe(). However, judging from the parameters of the latter function having __iomem attributes, we should not be remapping them. So, remove those IOMEM calls and instead do explicit remapping in bochs_isa_detect(), which was missing it. Also fix bochs_hw_probe() declaration missing one __iomem. Signed-off-by: Denis Orlov Reviewed-by: Ahmad Fatoum Link: https://lore.barebox.org/20230511124743.2878952-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer --- drivers/video/bochs/bochs_hw.c | 4 ++-- drivers/video/bochs/bochs_hw.h | 2 +- drivers/video/bochs/bochs_isa.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/bochs/bochs_hw.c b/drivers/video/bochs/bochs_hw.c index f31020acd4..48de5ea0bd 100644 --- a/drivers/video/bochs/bochs_hw.c +++ b/drivers/video/bochs/bochs_hw.c @@ -158,8 +158,8 @@ int bochs_hw_probe(struct device *dev, void __iomem *fb_map, bochs = xzalloc(sizeof(*bochs)); - bochs->fb_map = IOMEM(fb_map); - bochs->mmio = IOMEM(mmio); + bochs->fb_map = fb_map; + bochs->mmio = mmio; ret = bochs_hw_read_version(bochs); if (ret < 0) { diff --git a/drivers/video/bochs/bochs_hw.h b/drivers/video/bochs/bochs_hw.h index e01ef13d47..c721113656 100644 --- a/drivers/video/bochs/bochs_hw.h +++ b/drivers/video/bochs/bochs_hw.h @@ -10,6 +10,6 @@ struct device; -int bochs_hw_probe(struct device *dev, void *fb_map, void __iomem *mmio); +int bochs_hw_probe(struct device *dev, void __iomem *fb_map, void __iomem *mmio); #endif diff --git a/drivers/video/bochs/bochs_isa.c b/drivers/video/bochs/bochs_isa.c index 3cedb5c345..50fdecd9c8 100644 --- a/drivers/video/bochs/bochs_isa.c +++ b/drivers/video/bochs/bochs_isa.c @@ -26,6 +26,6 @@ static int bochs_isa_detect(void) if (ret) return ret; - return bochs_hw_probe(dev, (void *)0xe0000000, NULL); + return bochs_hw_probe(dev, IOMEM(0xe0000000), NULL); } device_initcall(bochs_isa_detect); -- cgit v1.2.1