• Jon Hunter's avatar
    cpufreq: tegra186: Fix sparse 'incorrect type in assignment' warning · b7b4e785
    Jon Hunter authored
    
    
    Sparse warns that the incorrect type is being assigned to the CPUFREQ
    driver_data variable in the Tegra186 CPUFREQ driver. The Tegra186
    CPUFREQ driver is assigned a type of 'void __iomem *' to a pointer of
    type 'void *' ...
    
     drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse: sparse: incorrect
     	type in assignment (different address spaces) @@
    	expected void *driver_data @@     got void [noderef] __iomem * @@
     ...
    
     drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse: sparse: incorrect
     	type in initializer (different address spaces) @@
    	expected void [noderef] __iomem *edvd_reg @@     got void *driver_data @@
    
    The Tegra186 CPUFREQ driver is using the policy->driver_data variable to
    store and iomem pointer to a Tegra186 CPU register that is used to set
    the clock speed for the CPU. This is not necessary because the register
    base address is already stored in the driver data and the offset of the
    register for each CPU is static. Therefore, fix this by adding a new
    structure with the register offsets for each CPU and store this in the
    main driver data structure along with the register base address. Please
    note that a new structure has been added for storing the register
    offsets rather than a simple array, because this will permit further
    clean-ups and simplification of the driver.
    Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    b7b4e785
tegra186-cpufreq.c 7.72 KB