Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: shmobile: R-Mobile: Clean up struct rmobile_pm_domain

Commit 59b89af1d5551c12 ("ARM: shmobile: sh7372: Remove Legacy C
SoC code") removed the last user of the rmobile_pm_domain.resume()
callback.

Commit 44d88c754e57a6d9 ("ARM: shmobile: Remove legacy SoC code
for R-Mobile A1") removed the last user of the rmobile_pm_domain.no_debug
flag and of the "pm-rmobile.h" header file (outside the actual driver).

Hence remove no longer used rmobile_pm_domain members, and absorb the
header file into the driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

authored by

Geert Uytterhoeven and committed by
Simon Horman
445aeb08 062887bf

+18 -41
+18 -19
arch/arm/mach-shmobile/pm-rmobile.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/pm.h> 20 20 #include <linux/pm_clock.h> 21 + #include <linux/pm_domain.h> 21 22 #include <linux/slab.h> 22 23 23 24 #include <asm/io.h> 24 - 25 - #include "pm-rmobile.h" 26 25 27 26 /* SYSC */ 28 27 #define SPDCR 0x08 /* SYS Power Down Control Register */ ··· 30 31 31 32 #define PSTR_RETRIES 100 32 33 #define PSTR_DELAY_US 10 34 + 35 + struct rmobile_pm_domain { 36 + struct generic_pm_domain genpd; 37 + struct dev_power_governor *gov; 38 + int (*suspend)(void); 39 + void __iomem *base; 40 + unsigned int bit_shift; 41 + }; 33 42 34 43 static inline 35 44 struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) ··· 72 65 } 73 66 } 74 67 75 - if (!rmobile_pd->no_debug) 76 - pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", 77 - genpd->name, mask, 78 - __raw_readl(rmobile_pd->base + PSTR)); 68 + pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask, 69 + __raw_readl(rmobile_pd->base + PSTR)); 79 70 80 71 return 0; 81 72 } 82 73 83 - static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd, 84 - bool do_resume) 74 + static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd) 85 75 { 86 76 unsigned int mask; 87 77 unsigned int retry_count; ··· 89 85 90 86 mask = BIT(rmobile_pd->bit_shift); 91 87 if (__raw_readl(rmobile_pd->base + PSTR) & mask) 92 - goto out; 88 + return ret; 93 89 94 90 __raw_writel(mask, rmobile_pd->base + SWUCR); 95 91 ··· 104 100 if (!retry_count) 105 101 ret = -EIO; 106 102 107 - if (!rmobile_pd->no_debug) 108 - pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", 109 - rmobile_pd->genpd.name, mask, 110 - __raw_readl(rmobile_pd->base + PSTR)); 111 - 112 - out: 113 - if (ret == 0 && rmobile_pd->resume && do_resume) 114 - rmobile_pd->resume(); 103 + pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", 104 + rmobile_pd->genpd.name, mask, 105 + __raw_readl(rmobile_pd->base + PSTR)); 115 106 116 107 return ret; 117 108 } 118 109 119 110 static int rmobile_pd_power_up(struct generic_pm_domain *genpd) 120 111 { 121 - return __rmobile_pd_power_up(to_rmobile_pd(genpd), true); 112 + return __rmobile_pd_power_up(to_rmobile_pd(genpd)); 122 113 } 123 114 124 115 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) ··· 126 127 genpd->power_on = rmobile_pd_power_up; 127 128 genpd->attach_dev = cpg_mstp_attach_dev; 128 129 genpd->detach_dev = cpg_mstp_detach_dev; 129 - __rmobile_pd_power_up(rmobile_pd, false); 130 + __rmobile_pd_power_up(rmobile_pd); 130 131 pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); 131 132 } 132 133
-22
arch/arm/mach-shmobile/pm-rmobile.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 2 - * 3 - * Copyright (C) 2012 Renesas Solutions Corp. 4 - * 5 - * Kuninori Morimoto <morimoto.kuninori@renesas.com> 6 - */ 7 - #ifndef PM_RMOBILE_H 8 - #define PM_RMOBILE_H 9 - 10 - #include <linux/pm_domain.h> 11 - 12 - struct rmobile_pm_domain { 13 - struct generic_pm_domain genpd; 14 - struct dev_power_governor *gov; 15 - int (*suspend)(void); 16 - void (*resume)(void); 17 - void __iomem *base; 18 - unsigned int bit_shift; 19 - bool no_debug; 20 - }; 21 - 22 - #endif /* PM_RMOBILE_H */