mbox series

[0/5] mmc: Constify struct sdhci_ops

Message ID 20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org
Headers show
Series mmc: Constify struct sdhci_ops | expand

Message

Krzysztof Kozlowski April 14, 2024, 7:15 a.m. UTC
Hi,

The local struct sdhci_ops can be made const for code safety.
No dependencies.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (5):
      mmc: sdhci-esdhc-mcf: Constify struct sdhci_ops
      mmc: sdhci-omap: Constify struct sdhci_ops
      mmc: sdhci-sprd: Constify struct sdhci_ops
      mmc: sdhci_am654: Constify struct sdhci_ops
      mmc: sdhci-s3c: Choose sdhci_ops based on variant

 drivers/mmc/host/sdhci-esdhc-mcf.c |  2 +-
 drivers/mmc/host/sdhci-omap.c      |  2 +-
 drivers/mmc/host/sdhci-s3c.c       | 31 +++++++++++++++++--------------
 drivers/mmc/host/sdhci-sprd.c      |  2 +-
 drivers/mmc/host/sdhci_am654.c     |  6 +++---
 5 files changed, 23 insertions(+), 20 deletions(-)
---
base-commit: f67245b3062cdc225b37003085bdb2916e1670b6
change-id: 20240414-mmc-const-sdhci-ops-c85762883004

Best regards,

Comments

Krzysztof Kozlowski April 14, 2024, 2:05 p.m. UTC | #1
On 14/04/2024 09:15, Krzysztof Kozlowski wrote:
>  
> -static struct sdhci_ops sdhci_s3c_ops = {
> +static const struct sdhci_ops sdhci_s3c_ops_s3c6410 = {
>  	.get_max_clock		= sdhci_s3c_get_max_clk,
>  	.set_clock		= sdhci_s3c_set_clock,
>  	.get_min_clock		= sdhci_s3c_get_min_clock,
> @@ -421,6 +423,15 @@ static struct sdhci_ops sdhci_s3c_ops = {
>  	.set_uhs_signaling	= sdhci_set_uhs_signaling,
>  };
>  
> +static const struct sdhci_ops sdhci_s3c_ops_exynos4 = {
> +	.get_max_clock		= sdhci_cmu_get_max_clock,
> +	.set_clock		= sdhci_cmu_set_clock,
> +	.get_min_clock		= sdhci_cmu_get_min_clock,
> +	.set_bus_width		= sdhci_set_bus_width,
> +	.reset			= sdhci_reset,
> +	.set_uhs_signaling	= sdhci_set_uhs_signaling,
> +};
> +
>  #ifdef CONFIG_OF

LKP reported now unused sdhci_s3c_ops_exynos4 for !CONFIG_OF. I will
send v2 (today, due to travel)


Best regards,
Krzysztof