/** * msm_bus_commit_fn() - Commits the data for fabric to rpm * @dev: fabric device * @data: NULL */ static int msm_bus_commit_fn(struct device *dev, void *data) { int ret = 0; struct msm_bus_fabric_device *fabdev = to_msm_bus_fabric_device(dev); MSM_BUS_DBG("Committing: fabid: %d\n", fabdev->id); ret = fabdev->algo->commit(fabdev); return ret; }
static int msm_bus_commit_limiter(struct device *dev, void *data) { int ret = 0; struct msm_bus_fabric_device *fabdev = to_msm_bus_fabric_device(dev); MSM_BUS_DBG("fabid: %d\n", fabdev->id); program_nr_limits(fabdev); return ret; }
int msm_bus_device_match(struct device *dev, void* id) { struct msm_bus_fabric_device *fabdev = to_msm_bus_fabric_device(dev); if (!fabdev) { MSM_BUS_WARN("Fabric %p returning 0\n", fabdev); return 0; } return (fabdev->id == (int)id); }
/** * msm_bus_get_fabric_device() - This function is used to search for * the fabric device on the bus * @fabid: Fabric id * Function returns: Pointer to the fabric device */ struct msm_bus_fabric_device *msm_bus_get_fabric_device(int fabid) { struct device *dev; struct msm_bus_fabric_device *fabric; dev = bus_find_device(&msm_bus_type, NULL, (void *)fabid, msm_bus_device_match); if (!dev) return NULL; fabric = to_msm_bus_fabric_device(dev); return fabric; }
static int clearvisitedflag(struct device *dev, void *data) { struct msm_bus_fabric_device *fabdev = to_msm_bus_fabric_device(dev); fabdev->visited = false; return 0; }