/** * devm_led_classdev_unregister() - resource managed led_classdev_unregister() * @parent: The device to unregister. * @led_cdev: the led_classdev structure for this device. */ void devm_led_classdev_unregister(struct device *dev, struct led_classdev *led_cdev) { WARN_ON(devres_release(dev, devm_led_classdev_release, devm_led_classdev_match, led_cdev)); }
/** * devm_regulator_unregister - Resource managed regulator_unregister() * @regulator: regulator to free * * Unregister a regulator registered with devm_regulator_register(). * Normally this function will not need to be called and the resource * management code will ensure that the resource is freed. */ void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev) { int rc; rc = devres_release(dev, devm_rdev_release, devm_rdev_match, rdev); if (rc != 0) WARN_ON(rc); }
void devm_clk_put(struct device *dev, struct clk *clk) { int ret; ret = devres_release(dev, devm_clk_release, devm_clk_match, clk); WARN_ON(ret); }
void devm_kobject_put(struct device *dev, struct kobject *kobj) { int ret; ret = devres_release(dev, devm_kobject_release, devm_kobject_match, kobj); WARN_ON(ret); }
void devm_unregister_esoc_client(struct device *dev, struct esoc_desc *esoc_desc) { int ret; ret = devres_release(dev, devm_esoc_desc_release, devm_esoc_desc_match, esoc_desc); WARN_ON(ret); }
/** * devm_regulator_put - Resource managed regulator_put() * @regulator: regulator to free * * Deallocate a regulator allocated with devm_regulator_get(). Normally * this function will not need to be called and the resource management * code will ensure that the resource is freed. */ void devm_regulator_put(struct regulator *regulator) { int rc; rc = devres_release(regulator->dev, devm_regulator_release, devm_regulator_match, regulator); if (rc != 0) WARN_ON(rc); }
/** * devm_regulator_unregister_supply_alias - Resource managed * regulator_unregister_supply_alias() * * @dev: device that will be given as the regulator "consumer" * @id: Supply name or regulator ID * * Unregister an alias registered with * devm_regulator_register_supply_alias(). Normally this function * will not need to be called and the resource management code * will ensure that the resource is freed. */ void devm_regulator_unregister_supply_alias(struct device *dev, const char *id) { struct regulator_supply_alias_match match; int rc; match.dev = dev; match.id = id; rc = devres_release(dev, devm_regulator_destroy_supply_alias, devm_regulator_match_supply_alias, &match); if (rc != 0) WARN_ON(rc); }
/** * devm_gpio_free - free an interrupt * @dev: device to free gpio for * @gpio: gpio to free * * Except for the extra @dev argument, this function takes the * same arguments and performs the same function as gpio_free(). * This function instead of gpio_free() should be used to manually * free GPIOs allocated with devm_gpio_request(). */ void devm_gpio_free(struct device *dev, unsigned int gpio) { WARN_ON(devres_release(dev, devm_gpio_release, devm_gpio_match, &gpio)); }
void devm_memunmap(struct device *dev, void *addr) { WARN_ON(devres_release(dev, devm_memremap_release, devm_memremap_match, addr)); }
/** * devm_gpiod_put - Resource-managed gpiod_put() * @desc: GPIO descriptor to dispose of * * Dispose of a GPIO descriptor obtained with devm_gpiod_get() or * devm_gpiod_get_index(). Normally this function will not be called as the GPIO * will be disposed of by the resource management code. */ void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) { WARN_ON(devres_release(dev, devm_gpiod_release, devm_gpiod_match, &desc)); }
/** * devm_iio_fifo_free - Resource-managed iio_kfifo_free() * @dev: Device the buffer belongs to * @r: The buffer associated with the device */ void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r) { WARN_ON(devres_release(dev, devm_iio_kfifo_release, devm_iio_kfifo_match, r)); }
/** * devm_gpiod_put_array - Resource-managed gpiod_put_array() * @descs: GPIO descriptor array to dispose of * * Dispose of an array of GPIO descriptors obtained with devm_gpiod_get_array(). * Normally this function will not be called as the GPIOs will be disposed of * by the resource management code. */ void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs) { WARN_ON(devres_release(dev, devm_gpiod_release_array, devm_gpiod_match_array, &descs)); }
/** * devm_thermal_zone_of_sensor_unregister - Resource managed version of * thermal_zone_of_sensor_unregister(). * @dev: Device for which which resource was allocated. * @tzd: a pointer to struct thermal_zone_device where the sensor is registered. * * This function removes the sensor callbacks and private data from the * thermal zone device registered with devm_thermal_zone_of_sensor_register() * API. It will also silent the zone by remove the .get_temp() and .get_trend() * thermal zone device callbacks. * Normally this function will not need to be called and the resource * management code will ensure that the resource is freed. */ void devm_thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd) { WARN_ON(devres_release(dev, devm_thermal_zone_of_sensor_release, devm_thermal_zone_of_sensor_match, tzd)); }