video: bochs: fix IOMEM usage
PATCH 1/1 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.
--- 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(-)
drivers/video/bochs/bochs_hw.c +2 -2
@@ -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 ) {
drivers/video/bochs/bochs_hw.h +1 -1
@@ -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
drivers/video/bochs/bochs_isa.c +1 -1
@@ -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);
Signature · 1 line
2.30.2
Quoted 11 lines · Denis Orlov
For the PCI version of the driver, we end up calling
IOMEM()twice on both thefb_mapand mmio pointers. This happens because we first usepci_iomap()on PCI resources in thebochs_pci_probe()and then explicitly callIOMEM()in thebochs_hw_probe(). However, judging from the parameters of the latter function having__iomemattributes, we should not be remapping them. So, remove those IOMEM calls and instead do explicit remapping inbochs_isa_detect(), which was missing it.Also fix
bochs_hw_probe()declaration missing one__iomem.Signed-off-by Denis Orlov <[email protected]>
Thanks!
Ahmad
Quoted 45 lines
--- 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(-)drivers/video/bochs/bochs_hw.c +2
-2@@ -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 ) {drivers/video/bochs/bochs_hw.h +1
-1@@ -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 drivers/video/bochs/bochs_isa.c +1
-1@@ -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);
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Sascha Hauer
AppliedQuoted 8 lines · Denis Orlov
For the PCI version of the driver, we end up calling
IOMEM()twice on both thefb_mapand mmio pointers. This happens because we first usepci_iomap()on PCI resources in thebochs_pci_probe()and then explicitly callIOMEM()in thebochs_hw_probe(). However, judging from the parameters of the latter function having__iomemattributes, we should not be remapping them. So, remove those IOMEM calls and instead do explicit remapping inbochs_isa_detect(), which was missing it.
Quoted 8 lines
Also fix
bochs_hw_probe()declaration missing one__iomem.Signed-off-by Denis Orlov <[email protected]>--- 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(-)
Applied, thanks
Sascha
Quoted 44 lines
drivers/video/bochs/bochs_hw.c +2
-2@@ -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 ) {drivers/video/bochs/bochs_hw.h +1
-1@@ -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 drivers/video/bochs/bochs_isa.c +1
-1@@ -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);Signature · 1 line
2.30.2
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |