Skip to content

Commit

Permalink
spi: spi-mem: Constify spi_mem->name
Browse files Browse the repository at this point in the history
There is no reason to make spi_mem->name modifiable. Moreover,
spi_mem_ops->get_name() returns a const char *, which generates a gcc
warning when assigning the value returned by spi_mem_ops->get_name()
to spi_mem->name.

Fixes: 5d27a9c ("spi: spi-mem: Extend the SPI mem interface to set a custom memory name")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Boris Brezillon authored and Mark Brown committed Aug 3, 2018
1 parent b02b17f commit 401c0d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/spi/spi-mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct spi_mem_op {
struct spi_mem {
struct spi_device *spi;
void *drvpriv;
char *name;
const char *name;
};

/**
Expand Down

0 comments on commit 401c0d7

Please sign in to comment.