aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hans-peter.nilsson@axis.com>2007-02-12 03:52:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:31 -0500
commit0ffa0285052607513a29f529ddb5061c907fd8a6 (patch)
treed7072494d6d8005c60d42c1c841628c7d486dd9a /drivers/spi/spi.c
parent7f8c7619ea1ff5ab8e0b08c8120d629834ef4253 (diff)
[PATCH] SPI cleanup() method param becomes non-const
I'd like to assign NULL to kfree()d members of a structure. I can't do that without ugly casting (see the PXA patch) when the structure pointed to is const-qualified. I don't really see a reason why the cleanup method isn't allowed to alter the object it should clean up. :-) No, I didn't test the PXA patch, but I verified that the NULL-assignment doesn't stop me from doing rmmod/insmodding my own spi_bitbang-based driver. Signed-off-by: Hans-Peter Nilsson <hp@axis.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6307428d2c94..2328128728be 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -32,7 +32,7 @@
32 */ 32 */
33static void spidev_release(struct device *dev) 33static void spidev_release(struct device *dev)
34{ 34{
35 const struct spi_device *spi = to_spi_device(dev); 35 struct spi_device *spi = to_spi_device(dev);
36 36
37 /* spi masters may cleanup for released devices */ 37 /* spi masters may cleanup for released devices */
38 if (spi->master->cleanup) 38 if (spi->master->cleanup)