Source
static ssize_t capability_id_show(struct device *dev, struct device_attribute *attr, char *buf)
/*
* Bus for UWB Multi-interface Controller capabilities.
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* This file is released under the GNU GPL v2.
*/
static int umc_bus_pre_reset_helper(struct device *dev, void *data)
{
int ret = 0;
if (dev->driver) {
struct umc_dev *umc = to_umc_dev(dev);
struct umc_driver *umc_drv = to_umc_driver(dev->driver);
if (umc_drv->pre_reset)
ret = umc_drv->pre_reset(umc);
else
device_release_driver(dev);
}
return ret;
}
static int umc_bus_post_reset_helper(struct device *dev, void *data)
{
int ret = 0;
if (dev->driver) {
struct umc_dev *umc = to_umc_dev(dev);
struct umc_driver *umc_drv = to_umc_driver(dev->driver);
if (umc_drv->post_reset)
ret = umc_drv->post_reset(umc);
} else
ret = device_attach(dev);
return ret;
}
/**
* umc_controller_reset - reset the whole UMC controller
* @umc: the UMC device for the radio controller.
*
* Drivers or all capabilities of the controller will have their
* pre_reset methods called or be unbound from their device. Then all
* post_reset methods will be called or the drivers will be rebound.
*
* Radio controllers must provide pre_reset and post_reset methods and
* reset the hardware in their start method.
*
* If this is called while a probe() or remove() is in progress it
* will return -EAGAIN and not perform the reset.
*/
int umc_controller_reset(struct umc_dev *umc)
{
struct device *parent = umc->dev.parent;