Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: buffer: drop devm_iio_hw_consumer_free() API call

It's unused so far, so it can be removed. Also makes sense to remove it
to discourage weird uses of this call during review.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Alexandru Ardelean and committed by
Jonathan Cameron
05c09e3c fc1f75a0

-32
-31
drivers/iio/buffer/industrialio-hw-consumer.c
··· 142 142 iio_hw_consumer_free(*(struct iio_hw_consumer **)res); 143 143 } 144 144 145 - static int devm_iio_hw_consumer_match(struct device *dev, void *res, void *data) 146 - { 147 - struct iio_hw_consumer **r = res; 148 - 149 - if (!r || !*r) { 150 - WARN_ON(!r || !*r); 151 - return 0; 152 - } 153 - return *r == data; 154 - } 155 - 156 145 /** 157 146 * devm_iio_hw_consumer_alloc - Resource-managed iio_hw_consumer_alloc() 158 147 * @dev: Pointer to consumer device. 159 148 * 160 149 * Managed iio_hw_consumer_alloc. iio_hw_consumer allocated with this function 161 150 * is automatically freed on driver detach. 162 - * 163 - * If an iio_hw_consumer allocated with this function needs to be freed 164 - * separately, devm_iio_hw_consumer_free() must be used. 165 151 * 166 152 * returns pointer to allocated iio_hw_consumer on success, NULL on failure. 167 153 */ ··· 171 185 return iio_hwc; 172 186 } 173 187 EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_alloc); 174 - 175 - /** 176 - * devm_iio_hw_consumer_free - Resource-managed iio_hw_consumer_free() 177 - * @dev: Pointer to consumer device. 178 - * @hwc: iio_hw_consumer to free. 179 - * 180 - * Free iio_hw_consumer allocated with devm_iio_hw_consumer_alloc(). 181 - */ 182 - void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc) 183 - { 184 - int rc; 185 - 186 - rc = devres_release(dev, devm_iio_hw_consumer_release, 187 - devm_iio_hw_consumer_match, hwc); 188 - WARN_ON(rc); 189 - } 190 - EXPORT_SYMBOL_GPL(devm_iio_hw_consumer_free); 191 188 192 189 /** 193 190 * iio_hw_consumer_enable() - Enable IIO hardware consumer
-1
include/linux/iio/hw-consumer.h
··· 14 14 struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev); 15 15 void iio_hw_consumer_free(struct iio_hw_consumer *hwc); 16 16 struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev); 17 - void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc); 18 17 int iio_hw_consumer_enable(struct iio_hw_consumer *hwc); 19 18 void iio_hw_consumer_disable(struct iio_hw_consumer *hwc); 20 19