From: Mark Brown Date: Fri, 11 Mar 2016 07:28:53 +0000 (+0700) Subject: Merge remote-tracking branches 'spi/topic/res', 'spi/topic/rockchip', 'spi/topic... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c508709bcffb644afbf5e5016fc7c90bf80c30ff;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge remote-tracking branches 'spi/topic/res', 'spi/topic/rockchip', 'spi/topic/sh', 'spi/topic/ti-qspi' and 'spi/topic/xilinx' into spi-next --- c508709bcffb644afbf5e5016fc7c90bf80c30ff diff --cc include/linux/spi/spi.h index f54667b7b3c8,5396ee5fc51f,53be3a4c60cb,53be3a4c60cb,ba0dee9d05a3,53be3a4c60cb..857a9a1d82b5 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@@@@@@ -600,37 -582,38 -582,6 -582,6 -587,6 -582,6 +600,38 @@@@@@@ extern void spi_unregister_master(struc extern struct spi_master *spi_busnum_to_master(u16 busnum); ++++/* ++++ * SPI resource management while processing a SPI message ++++ */ ++++ + ++++typedef void (*spi_res_release_t)(struct spi_master *master, + ++++ struct spi_message *msg, + ++++ void *res); + ++++ ++++/** ++++ * struct spi_res - spi resource management structure ++++ * @entry: list entry ++++ * @release: release code called prior to freeing this resource ++++ * @data: extra data allocated for the specific use-case ++++ * ++++ * this is based on ideas from devres, but focused on life-cycle ++++ * management during spi_message processing ++++ */ - typedef void (*spi_res_release_t)(struct spi_master *master, - struct spi_message *msg, - void *res); ++++struct spi_res { ++++ struct list_head entry; ++++ spi_res_release_t release; ++++ unsigned long long data[]; /* guarantee ull alignment */ ++++}; ++++ ++++extern void *spi_res_alloc(struct spi_device *spi, ++++ spi_res_release_t release, ++++ size_t size, gfp_t gfp); ++++extern void spi_res_add(struct spi_message *message, void *res); ++++extern void spi_res_free(void *res); ++++ ++++extern void spi_res_release(struct spi_master *master, ++++ struct spi_message *message); ++++ /*---------------------------------------------------------------------------*/ /*