Rather than having 3 almost-identical functions plus the machinery to keep track of them, it's far simpler to just dynamically select the appropriate register field per variant.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -620,7 +620,6 @@ struct rk808 { · 619 unmodified lines | |||
| 620 | long variant; | 620 | long variant; |
| 621 | const struct regmap_config *regmap_cfg; | 621 | const struct regmap_config *regmap_cfg; |
| 622 | const struct regmap_irq_chip *regmap_irq_chip; | 622 | const struct regmap_irq_chip *regmap_irq_chip; |
| 623 | void (*pm_pwroff_fn)(void); | ||
| 624 | void (*pm_pwroff_prep_fn)(void); | 623 | void (*pm_pwroff_prep_fn)(void); |
| 625 | }; | 624 | }; |
| 626 | #endif /* __LINUX_REGULATOR_RK808_H */ | 625 | #endif /* __LINUX_REGULATOR_RK808_H */ |