Skip to content

Commit

Permalink
drivers: sdhc: set 'sdhc_driver_api' as 'static const'
Browse files Browse the repository at this point in the history
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
  • Loading branch information
ndrs-pst authored and fabiobaltieri committed Jan 24, 2024
1 parent cf6a382 commit e7875de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/sdhc/sdhc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ static int sdhc_spi_init(const struct device *dev)
return ret;
}

static struct sdhc_driver_api sdhc_spi_api = {
static const struct sdhc_driver_api sdhc_spi_api = {
.request = sdhc_spi_request,
.set_io = sdhc_spi_set_io,
.get_host_props = sdhc_spi_get_host_props,
Expand Down

0 comments on commit e7875de

Please sign in to comment.