本文整理汇总了C++中device_for_each_child函数的典型用法代码示例。如果您正苦于以下问题:C++ device_for_each_child函数的具体用法?C++ device_for_each_child怎么用?C++ device_for_each_child使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了device_for_each_child函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pcie_portdrv_error_detected
static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,
enum pci_channel_state error)
{
struct aer_broadcast_data data = {error, PCI_ERS_RESULT_CAN_RECOVER};
/* get true return value from &data */
device_for_each_child(&dev->dev, &data, error_detected_iter);
return data.result;
}
开发者ID:ParrotSec,项目名称:linux-psec,代码行数:9,代码来源:portdrv_pci.c
示例2: gsc_fixup_irqs
void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl,
void (*choose_irq)(struct parisc_device *, void *))
{
struct gsc_fixup_struct data = {
.choose_irq = choose_irq,
.ctrl = ctrl,
};
device_for_each_child(&parent->dev, &data, gsc_fixup_irqs_callback);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:10,代码来源:gsc.c
示例3: camera_auto_detect
static int camera_auto_detect(void)
{
struct i2c_adapter *adap = i2c_get_adapter(2);
pr_info("%s ++ %04x - %04x - %04x\n",
__func__, ad5816_devid, dw9718_devid, max77387_devid);
if ((ad5816_devid & 0xff00) == 0x2400) {
if ((max77387_devid & 0xff) == 0x91) {
/* IMX135 found */
i2c_new_device(adap, &pluto_i2c_board_info_imx135);
} else {
/* IMX091 found*/
i2c_new_device(adap, &pluto_i2c_board_info_imx091);
}
} else if (dw9718_devid) {
if (!max77387_devid) {
/* board e1823, IMX135 found */
i2c_new_device(adap, &pluto_i2c_board_info_imx135);
/* remove current dw9718 */
device_for_each_child(&adap->dev,
&pluto_i2c_board_info_dw9718.addr,
pluto_chk_conflict);
/* reinstall with new device node */
pluto_dw9718_pdata.num = 0;
i2c_new_device(adap, &pluto_i2c_board_info_dw9718);
} else {
/* AR0833 found */
i2c_new_device(adap, &pluto_i2c_board_info_ar0833);
}
} else { /* default using ov5693 + ad5823 */
device_for_each_child(&adap->dev,
&pluto_i2c_board_info_ad5823.addr,
pluto_chk_conflict);
i2c_new_device(adap, &pluto_i2c_board_info_ov5693);
i2c_new_device(adap, &pluto_i2c_board_info_ad5823);
}
i2c_new_device(adap, &pluto_i2c_board_info_imx132);
pr_info("%s --\n", __func__);
return 0;
}
开发者ID:aicjofs,项目名称:android_kernel_fuhu_t8400n,代码行数:42,代码来源:board-pluto-sensors.c
示例4: smsc_hub_disable
static int smsc_hub_disable(struct hsic_hub *hub)
{
struct smsc_hub_platform_data *pdata = hub->pdata;
pm_runtime_forbid(hub->dev);
device_for_each_child(hub->dev, NULL, sms_hub_remove_child);
gpio_direction_output(pdata->hub_reset, 0);
gpio_direction_output(pdata->xo_clk_gpio, 0);
return 0;
}
开发者ID:Leoyzen,项目名称:Charm-Eye,代码行数:11,代码来源:smsc_hub.c
示例5: kdwc3_remove
static int kdwc3_remove(struct platform_device *pdev)
{
struct dwc3_keystone *kdwc = platform_get_drvdata(pdev);
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
clk_disable_unprepare(kdwc->clk);
platform_set_drvdata(pdev, NULL);
return 0;
}
开发者ID:Chong-Li,项目名称:cse522,代码行数:11,代码来源:dwc3-keystone.c
示例6: pcie_portdrv_error_detected
static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,
enum pci_channel_state error)
{
struct aer_broadcast_data data = {error, PCI_ERS_RESULT_CAN_RECOVER};
int ret;
/* can not fail */
ret = device_for_each_child(&dev->dev, &data, error_detected_iter);
return data.result;
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:11,代码来源:portdrv_pci.c
示例7: dwc3_exynos_remove
static int dwc3_exynos_remove(struct platform_device *pdev)
{
struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
platform_device_unregister(exynos->usb2_phy);
platform_device_unregister(exynos->usb3_phy);
clk_disable_unprepare(exynos->clk);
return 0;
}
开发者ID:AnadoluPanteri,项目名称:kernel-plus-harmattan,代码行数:12,代码来源:dwc3-exynos.c
示例8: dwc3_omap_remove
static int dwc3_omap_remove(struct platform_device *pdev)
{
struct dwc3_omap *omap = platform_get_drvdata(pdev);
platform_device_unregister(omap->usb2_phy);
platform_device_unregister(omap->usb3_phy);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
return 0;
}
开发者ID:Babel-builder,项目名称:linux,代码行数:12,代码来源:dwc3-omap.c
示例9: nvdimm_bus_check_dimm_count
int nvdimm_bus_check_dimm_count(struct nvdimm_bus *nvdimm_bus, int dimm_count)
{
int count = 0;
/* Flush any possible dimm registration failures */
nd_synchronize();
device_for_each_child(&nvdimm_bus->dev, &count, count_dimms);
dev_dbg(&nvdimm_bus->dev, "%s: count: %d\n", __func__, count);
if (count != dimm_count)
return -ENXIO;
return 0;
}
开发者ID:Chong-Li,项目名称:cse522,代码行数:12,代码来源:dimm_devs.c
示例10: nd_is_uuid_unique
/**
* nd_is_uuid_unique - verify that no other namespace has @uuid
* @dev: any device on a nvdimm_bus
* @uuid: uuid to check
*/
bool nd_is_uuid_unique(struct device *dev, u8 *uuid)
{
struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev);
if (!nvdimm_bus)
return false;
WARN_ON_ONCE(!is_nvdimm_bus_locked(&nvdimm_bus->dev));
if (device_for_each_child(&nvdimm_bus->dev, uuid,
is_namespace_uuid_busy) != 0)
return false;
return true;
}
开发者ID:Chong-Li,项目名称:cse522,代码行数:17,代码来源:namespace_devs.c
示例11: omap_ocp2scp_probe
static int omap_ocp2scp_probe(struct platform_device *pdev)
{
int ret;
u32 reg;
void __iomem *regs;
struct resource *res;
struct device_node *np = pdev->dev.of_node;
if (np) {
ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
if (ret) {
dev_err(&pdev->dev,
"failed to add resources for ocp2scp child\n");
goto err0;
}
}
pm_runtime_enable(&pdev->dev);
/*
* As per AM572x TRM: http://www.ti.com/lit/ug/spruhz6/spruhz6.pdf
* under section 26.3.2.2, table 26-26 OCP2SCP TIMING Caution;
* As per OMAP4430 TRM: http://www.ti.com/lit/ug/swpu231ap/swpu231ap.pdf
* under section 23.12.6.2.2 , Table 23-1213 OCP2SCP TIMING Caution;
* As per OMAP4460 TRM: http://www.ti.com/lit/ug/swpu235ab/swpu235ab.pdf
* under section 23.12.6.2.2, Table 23-1213 OCP2SCP TIMING Caution;
* As per OMAP543x TRM http://www.ti.com/lit/pdf/swpu249
* under section 27.3.2.2, Table 27-27 OCP2SCP TIMING Caution;
*
* Read path of OCP2SCP is not working properly due to low reset value
* of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6 or more.
*/
if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(regs))
goto err0;
pm_runtime_get_sync(&pdev->dev);
reg = readl_relaxed(regs + OCP2SCP_TIMING);
reg &= ~(SYNC2_MASK);
reg |= 0x6;
writel_relaxed(reg, regs + OCP2SCP_TIMING);
pm_runtime_put_sync(&pdev->dev);
}
return 0;
err0:
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
return ret;
}
开发者ID:varigit,项目名称:VAR-SOM-AM33-Kernel-3-14,代码行数:52,代码来源:omap-ocp2scp.c
示例12: umc_bus_rescan
static void umc_bus_rescan(struct device *parent)
{
int err;
/*
* We can't use bus_rescan_devices() here as it deadlocks when
* it tries to retake the dev->parent semaphore.
*/
err = device_for_each_child(parent, NULL, umc_bus_rescan_helper);
if (err < 0)
printk(KERN_WARNING "%s: rescan of bus failed: %d\n",
KBUILD_MODNAME, err);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:13,代码来源:umc-bus.c
示例13: pcie_portdrv_slot_reset
static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev)
{
pci_ers_result_t status;
/* If fatal, restore cfg space for possible link reset at upstream */
if (dev->error_state == pci_channel_io_frozen) {
pcie_portdrv_restore_config(dev);
pci_enable_pcie_error_reporting(dev);
}
device_for_each_child(&dev->dev, &status, slot_reset_iter);
return status;
}
开发者ID:zhoupeng,项目名称:spice4xen,代码行数:14,代码来源:portdrv_pci.c
示例14: omapdss_hdmihw_remove
static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
{
device_for_each_child(&pdev->dev, NULL, hdmi_remove_child);
dss_unregister_child_devices(&pdev->dev);
hdmi_panel_exit();
hdmi_uninit_output(pdev);
pm_runtime_disable(&pdev->dev);
return 0;
}
开发者ID:debbiche,项目名称:android_kernel_huawei_p8,代码行数:14,代码来源:hdmi.c
示例15: arche_platform_remove
static int arche_platform_remove(struct platform_device *pdev)
{
struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
unregister_pm_notifier(&arche_pdata->pm_notifier);
device_remove_file(&pdev->dev, &dev_attr_state);
device_for_each_child(&pdev->dev, NULL, arche_remove_child);
arche_platform_poweroff_seq(arche_pdata);
if (usb3613_hub_mode_ctrl(false))
dev_warn(arche_pdata->dev, "failed to control hub device\n");
/* TODO: Should we do anything more here ?? */
return 0;
}
开发者ID:Anjali05,项目名称:linux,代码行数:14,代码来源:arche-platform.c
示例16: nd_region_remove
static int nd_region_remove(struct device *dev)
{
struct nd_region *nd_region = to_nd_region(dev);
/* flush attribute readers and disable */
nvdimm_bus_lock(dev);
nd_region->ns_seed = NULL;
nd_region->btt_seed = NULL;
nd_region->pfn_seed = NULL;
dev_set_drvdata(dev, NULL);
nvdimm_bus_unlock(dev);
device_for_each_child(dev, NULL, child_unregister);
return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:15,代码来源:region.c
示例17: dwc3_omap_remove
static int dwc3_omap_remove(struct platform_device *pdev)
{
struct dwc3_omap *omap = platform_get_drvdata(pdev);
if (omap->extcon_vbus_dev.edev)
extcon_unregister_interest(&omap->extcon_vbus_dev);
if (omap->extcon_id_dev.edev)
extcon_unregister_interest(&omap->extcon_id_dev);
dwc3_omap_disable_irqs(omap);
device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0;
}
开发者ID:atmark-techno,项目名称:linux-3.14-at,代码行数:15,代码来源:dwc3-omap.c
示例18: dprc_remove_devices
/**
* dprc_remove_devices - Removes devices for objects removed from a DPRC
*
* @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC object
* @obj_desc_array: array of object descriptors for child objects currently
* present in the DPRC in the MC.
* @num_child_objects_in_mc: number of entries in obj_desc_array
*
* Synchronizes the state of the Linux bus driver with the actual state of
* the MC by removing devices that represent MC objects that have
* been dynamically removed in the physical DPRC.
*/
static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev,
struct dprc_obj_desc *obj_desc_array,
int num_child_objects_in_mc)
{
if (num_child_objects_in_mc != 0) {
/*
* Remove child objects that are in the DPRC in Linux,
* but not in the MC:
*/
struct dprc_child_objs objs;
objs.child_count = num_child_objects_in_mc;
objs.child_array = obj_desc_array;
device_for_each_child(&mc_bus_dev->dev, &objs,
__fsl_mc_device_remove_if_not_in_mc);
} else {
/*
* There are no child objects for this DPRC in the MC.
* So, remove all the child devices from Linux:
*/
device_for_each_child(&mc_bus_dev->dev, NULL,
__fsl_mc_device_remove);
}
}
开发者ID:acton393,项目名称:linux,代码行数:36,代码来源:dprc-driver.c
示例19: pcie_portdrv_slot_reset
static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev)
{
pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;
/* If fatal, restore cfg space for possible link reset at upstream */
if (dev->error_state == pci_channel_io_frozen) {
dev->state_saved = true;
pci_restore_state(dev);
pcie_portdrv_restore_config(dev);
pci_enable_pcie_error_reporting(dev);
}
/* get true return value from &status */
device_for_each_child(&dev->dev, &status, slot_reset_iter);
return status;
}
开发者ID:ParrotSec,项目名称:linux-psec,代码行数:16,代码来源:portdrv_pci.c
示例20: rpmsg_remove
static void __devexit rpmsg_remove(struct virtio_device *vdev)
{
struct virtproc_info *vrp = vdev->priv;
int ret;
ret = device_for_each_child(&vdev->dev, NULL, rpmsg_remove_device);
if (ret)
dev_warn(&vdev->dev, "can't remove rpmsg device: %d\n", ret);
idr_remove_all(&vrp->endpoints);
idr_destroy(&vrp->endpoints);
vdev->config->del_vqs(vrp->vdev);
kfree(vrp);
}
开发者ID:ArgentymDIM,项目名称:android_kernel_huawei_D1_P1,代码行数:16,代码来源:virtio_rpmsg_bus.c
注:本文中的device_for_each_child函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论