From 0ffa0285052607513a29f529ddb5061c907fd8a6 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 12 Feb 2007 00:52:45 -0800 Subject: [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 Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/spi/spi.h | 2 +- include/linux/spi/spi_bitbang.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 851b25d6e82b..9d8d63109a8f 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -220,7 +220,7 @@ struct spi_master { struct spi_message *mesg); /* called on release() to free memory provided by spi_master */ - void (*cleanup)(const struct spi_device *spi); + void (*cleanup)(struct spi_device *spi); }; static inline void *spi_master_get_devdata(struct spi_master *master) diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 16ce178f54d7..2e8c048b9b80 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h @@ -55,7 +55,7 @@ struct spi_bitbang { * methods, if you like. */ extern int spi_bitbang_setup(struct spi_device *spi); -extern void spi_bitbang_cleanup(const struct spi_device *spi); +extern void spi_bitbang_cleanup(struct spi_device *spi); extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); extern int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t); -- cgit v1.2.3-59-g8ed1b