]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memory: tegra: Constify struct thermal_cooling_device_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 28 Nov 2021 20:41:58 +0000 (21:41 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 27 Jan 2022 09:41:54 +0000 (10:41 +0100)
The only usage of tegra210_emc_cd_ops is to pass its address to
devm_thermal_of_cooling_device_register() which is a pointer to const
struct thermal_cooling_device_ops. Make it const to allow the compiler
to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211128204158.19544-1-rikard.falkeborn@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
drivers/memory/tegra/tegra210-emc-core.c

index 13584f9317a4f0b039b200aab3004b124964f9ad..cbe1a772351457f41979cd0af4dcdb0a1b590d5f 100644 (file)
@@ -711,7 +711,7 @@ static int tegra210_emc_cd_set_state(struct thermal_cooling_device *cd,
        return 0;
 }
 
-static struct thermal_cooling_device_ops tegra210_emc_cd_ops = {
+static const struct thermal_cooling_device_ops tegra210_emc_cd_ops = {
        .get_max_state = tegra210_emc_cd_max_state,
        .get_cur_state = tegra210_emc_cd_get_state,
        .set_cur_state = tegra210_emc_cd_set_state,