Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463632
| From | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] spi: spi-fsl-dspi: constify devtype_data |
| Date | 2016-08-16 12:00 +0200 |
| Message-ID | <s6Jk6-1sx-49@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
of_id->data is const, so instead of casting the pointer to drop its
const status, this patch constify the devtype_data pointer.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
drivers/spi/spi-fsl-dspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 9e9dadb..ab6b9e1 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -159,7 +159,7 @@ struct fsl_dspi {
u8 cs;
u16 void_write_data;
u32 cs_change;
- struct fsl_dspi_devtype_data *devtype_data;
+ const struct fsl_dspi_devtype_data *devtype_data;
wait_queue_head_t waitq;
u32 waitflags;
@@ -686,7 +686,7 @@ static int dspi_probe(struct platform_device *pdev)
}
master->bus_num = bus_num;
- dspi->devtype_data = (struct fsl_dspi_devtype_data *)of_id->data;
+ dspi->devtype_data = of_id->data;
if (!dspi->devtype_data) {
dev_err(&pdev->dev, "can't get devtype_data\n");
ret = -EFAULT;
--
2.7.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/2] spi: spi-fsl-dspi: constify devtype_data LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-16 12:00 +0200
[PATCH 2/2] spi: spi-fsl-dspi: fix a possible NULL dereference LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-16 12:00 +0200
Applied "spi: spi-fsl-dspi: fix a possible NULL dereference" to the spi tree Mark Brown <broonie@kernel.org> - 2016-08-16 13:40 +0200
Applied "spi: spi-fsl-dspi: constify devtype_data" to the spi tree Mark Brown <broonie@kernel.org> - 2016-08-16 13:40 +0200
csiph-web