[PATCH 2/9] soc: samsung: exynos-pmu: Add exynos_pmu_update/read/write APIs and SoC quirks

Arnd Bergmann arnd at arndb.de
Tue Jan 23 00:10:36 PST 2024


On Mon, Jan 22, 2024, at 23:57, Peter Griffin wrote:

> --- a/include/linux/soc/samsung/exynos-pmu.h
> +++ b/include/linux/soc/samsung/exynos-pmu.h
> @@ -21,11 +21,39 @@ enum sys_powerdown {
>  extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
>  #ifdef CONFIG_EXYNOS_PMU
>  extern struct regmap *exynos_get_pmu_regmap(void);
> +extern int exynos_pmu_update_bits(unsigned int offset, unsigned int 
> mask,
> +				  unsigned int val);
> +extern int exynos_pmu_update(unsigned int offset, unsigned int mask,
> +			     unsigned int val);
> +extern int exynos_pmu_write(unsigned int offset, unsigned int val);
> +extern int exynos_pmu_read(unsigned int offset, unsigned int *val);
>  #else
>  static inline struct regmap *exynos_get_pmu_regmap(void)
>  {
>  	return ERR_PTR(-ENODEV);
>  }
> +
> +static inline int exynos_pmu_update_bits(unsigned int offset, unsigned 
> int mask,
> +					 unsigned int val);
> +{
> +	return ERR_PTR(-ENODEV);
> +}
> +
> +static inline int exynos_pmu_update(unsigned int offset, unsigned int 
> mask,
> +				    unsigned int val);
> +{
> +	return ERR_PTR(-ENODEV);
> +}

This won't build since you have the wrong return type.
I would suggest you just remove the #ifdef check entirely
and instead require drivers using this to have correct
dependencies.

    Arnd



More information about the linux-arm-kernel mailing list