lantiq: ltq-ifxos: add kernel 5.10 compatiblity
authorMathias Kresin <dev@kresin.me>
Sun, 27 Dec 2020 11:26:28 +0000 (12:26 +0100)
committerMathias Kresin <dev@kresin.me>
Mon, 12 Apr 2021 21:23:09 +0000 (23:23 +0200)
ioremap has provided non-cached semantics by default since the Linux 2.6
days and was removed with kernel version 5.6.

Signed-off-by: Mathias Kresin <dev@kresin.me>
package/kernel/lantiq/ltq-ifxos/patches/100-compat.patch

index 80275e6b112453d150a76593840444234ea4b69d..d9bbf8d7ccf16d41eb09dfd61ff370dec66defb7 100644 (file)
     if ( check_mem_region(physicalAddr, addrRangeSize_byte) )
     {
        IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR, 
-@@ -98,6 +100,16 @@ IFX_int32_t IFXOS_Phy2VirtMap(
+@@ -98,10 +100,25 @@ IFX_int32_t IFXOS_Phy2VirtMap(
  
     /* can't fail */
     request_mem_region(physicalAddr, addrRangeSize_byte, pName);
 +#endif
  
     /* remap memory (not cache able): physical --> virtual */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
     pVirtAddr = (IFX_uint8_t *)ioremap_nocache( physicalAddr,
+                                                addrRangeSize_byte );
++#else
++   pVirtAddr = (IFX_uint8_t *)ioremap(physicalAddr, addrRangeSize_byte);
++#endif
++
+    if (pVirtAddr == IFX_NULL)
+    {
+       IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,