这篇教程C++ usb_disabled函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中usb_disabled函数的典型用法代码示例。如果您正苦于以下问题:C++ usb_disabled函数的具体用法?C++ usb_disabled怎么用?C++ usb_disabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了usb_disabled函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ehci_orion_initstatic int __init ehci_orion_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ehci_init_driver(&ehci_orion_hc_driver, NULL); return platform_driver_register(&ehci_orion_driver);}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:10,
示例2: ohci_hcd_mcs814x_drv_probestatic int ohci_hcd_mcs814x_drv_probe(struct platform_device *pdev){ int ret; ret = -ENODEV; if (!usb_disabled()) ret = usb_hcd_mcs814x_probe(&ohci_mcs814x_hc_driver, pdev); return ret;}
开发者ID:JBTech,项目名称:Mamba,代码行数:10,
示例3: ohci_omap_initstatic int __init ohci_omap_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ohci_init_driver(&ohci_omap_hc_driver, &omap_overrides); return platform_driver_register(&ohci_hcd_omap_driver);}
开发者ID:mkrufky,项目名称:linux,代码行数:10,
示例4: ohci_hcd_pci_initstatic int __init ohci_hcd_pci_init (void) { printk (KERN_DEBUG "%s: " DRIVER_INFO " (PCI)/n", hcd_name); if (usb_disabled()) return -ENODEV; pr_debug ("%s: block sizes: ed %Zd td %Zd/n", hcd_name, sizeof (struct ed), sizeof (struct td)); return pci_register_driver (&ohci_pci_driver);}
开发者ID:AxelLin,项目名称:Drv,代码行数:10,
示例5: ehci_msm2_initstatic int __init ehci_msm2_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ehci_init_driver(&ehci_msm2_hc_driver, &ehci_msm2_overrides); return platform_driver_register(&ehci_msm2_driver);}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:10,
示例6: ohci_hcd_rtl8652_drv_probestatic int ohci_hcd_rtl8652_drv_probe(struct platform_device *pdev){ int ret; ret = -ENODEV; if (!usb_disabled()) { ret = usb_hcd_rtl8652_probe(&ohci_rtl8652_hc_driver, pdev); } return ret;}
开发者ID:ClarkChen633,项目名称:rtl819x-toolchain,代码行数:11,
示例7: ohci_hcd_ep93xx_drv_probestatic int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev){ struct usb_hcd *hcd; struct resource *res; int irq; int ret; if (usb_disabled()) return -ENODEV; irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO; hcd = usb_create_hcd(&ohci_ep93xx_hc_driver, &pdev->dev, "ep93xx"); if (!hcd) return -ENOMEM; hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { ret = PTR_ERR(hcd->regs); goto err_put_hcd; } usb_host_clock = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(usb_host_clock)) { ret = PTR_ERR(usb_host_clock); goto err_put_hcd; } clk_enable(usb_host_clock); ohci_hcd_init(hcd_to_ohci(hcd)); ret = usb_add_hcd(hcd, irq, 0); if (ret) goto err_clk_disable; return 0;err_clk_disable: clk_disable(usb_host_clock);err_put_hcd: usb_put_hcd(hcd); return ret;}
开发者ID:AeroGirl,项目名称:VAR-SOM-AM33-SDK7-Kernel,代码行数:54,
示例8: ehci_drv_ar9130_probestatic int ehci_drv_ar9130_probe(struct device *dev){ struct platform_device *pdev = to_platform_device(dev); struct usb_hcd *hcd = dev_get_drvdata(dev); if(usb_disabled()){ ar9130_error("USB_DISABLED /n"); return -ENODEV; } return usb_ehci_ar9130_probe(&ehci_hc_ar9130_driver,&hcd,pdev);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:11,
示例9: ohci_pxa27x_initstatic int __init ohci_pxa27x_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ohci_init_driver(&ohci_pxa27x_hc_driver, &pxa27x_overrides); ohci_pxa27x_hc_driver.hub_control = pxa27x_ohci_hub_control; return platform_driver_register(&ohci_hcd_pxa27x_driver);}
开发者ID:AshishNamdev,项目名称:linux,代码行数:12,
示例10: ehci_hcd_ls1x_probestatic int ehci_hcd_ls1x_probe(struct platform_device *pdev){ struct usb_hcd *hcd; struct resource *res; int irq; int ret; pr_debug("initializing loongson1 ehci USB Controller/n"); if (usb_disabled()) return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, "Found HC with no IRQ. Check %s setup!/n", dev_name(&pdev->dev)); return -ENODEV; } irq = res->start; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "Found HC with no register addr. Check %s setup!/n", dev_name(&pdev->dev)); return -ENODEV; } hcd = usb_create_hcd(&ehci_ls1x_hc_driver, &pdev->dev, dev_name(&pdev->dev)); if (!hcd) return -ENOMEM; hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (hcd->regs == NULL) { dev_dbg(&pdev->dev, "error mapping memory/n"); ret = -EFAULT; goto err_put_hcd; } ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto err_put_hcd; return ret;err_put_hcd: usb_put_hcd(hcd); return ret;}
开发者ID:LITMUS-RT,项目名称:litmus-rt-odroidx,代码行数:53,
示例11: str9100_ehci_hcd_initstatic int __init str9100_ehci_hcd_init(void){ if (usb_disabled()) return -ENODEV; pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd/n", hcd_name, sizeof(struct ehci_qh), sizeof(struct ehci_qtd), sizeof(struct ehci_itd), sizeof(struct ehci_sitd)); return platform_driver_register(&str9100_ehci_hcd_driver);}
开发者ID:mmk622,项目名称:ts_7500_kernel,代码行数:12,
示例12: ohci_hcd_lh7a404_drv_probestatic int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev){ int ret; pr_debug ("In ohci_hcd_lh7a404_drv_probe"); if (usb_disabled()) return -ENODEV; ret = usb_hcd_lh7a404_probe(&ohci_lh7a404_hc_driver, pdev); return ret;}
开发者ID:B-Rich,项目名称:linux_drivers,代码行数:12,
示例13: vt8500_ehci_drv_probestatic int vt8500_ehci_drv_probe(struct platform_device *pdev){ struct usb_hcd *hcd; struct ehci_hcd *ehci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ"); return -ENOMEM; } hcd = usb_create_hcd(&vt8500_ehci_hc_driver, &pdev->dev, "VT8500"); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed"); ret = -EBUSY; goto err1; } hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { pr_debug("ioremap failed"); ret = -ENOMEM; goto err2; } ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; } iounmap(hcd->regs);err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len);err1: usb_put_hcd(hcd); return ret;}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:52,
示例14: ohci_hcd_pxa27x_drv_probestatic int ohci_hcd_pxa27x_drv_probe(struct device *dev){ struct platform_device *pdev = to_platform_device(dev); int ret; pr_debug ("In ohci_hcd_pxa27x_drv_probe"); if (usb_disabled()) return -ENODEV; ret = usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev); return ret;}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:13,
示例15: ehci_s5p_initstatic int __init ehci_s5p_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ehci_init_driver(&s5p_ehci_hc_driver, &s5p_overrides); bus_resume = s5p_ehci_hc_driver.bus_resume; s5p_ehci_hc_driver.bus_resume = s5p_ehci_bus_resume; return platform_driver_register(&s5p_ehci_driver);}
开发者ID:ShedrockN4,项目名称:wiliteneo,代码行数:13,
示例16: ehci_rtl819x_driver_probestatic int ehci_rtl819x_driver_probe(struct platform_device *pdev){ struct usb_hcd *hcd = NULL; int ret; if (usb_disabled()) return -ENODEV; ret = ehci_rtl819x_probe(&ehci_rtl819x_hc_driver, &hcd, pdev); //ret = usb_hcd_rtl8652_probe(&ehci_rtl819x_hc_driver, pdev); return ret;}
开发者ID:cmotc,项目名称:openwrt-realtek,代码行数:13,
示例17: ehci_hcd_au1xxx_drv_probestatic int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev){ struct usb_hcd *hcd = NULL; int ret; pr_debug("In ehci_hcd_au1xxx_drv_probe/n"); if (usb_disabled()) return -ENODEV; ret = usb_ehci_au1xxx_probe(&ehci_au1xxx_hc_driver, &hcd, pdev); return ret;}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:13,
示例18: usb_init/* * Init */static int __init usb_init(void){ int retval; if (usb_disabled()) { pr_info("%s: USB support disabled/n", usbcore_name); return 0; } usb_init_pool_max(); usb_debugfs_init(); usb_acpi_register(); retval = bus_register(&usb_bus_type); if (retval) goto bus_register_failed; retval = bus_register_notifier(&usb_bus_type, &usb_bus_nb); if (retval) goto bus_notifier_failed; retval = usb_major_init(); if (retval) goto major_init_failed; retval = usb_register(&usbfs_driver); if (retval) goto driver_register_failed; retval = usb_devio_init(); if (retval) goto usb_devio_init_failed; retval = usb_hub_init(); if (retval) goto hub_init_failed; retval = usb_register_device_driver(&usb_generic_driver, THIS_MODULE); if (!retval) goto out; usb_hub_cleanup();hub_init_failed: usb_devio_cleanup();usb_devio_init_failed: usb_deregister(&usbfs_driver);driver_register_failed: usb_major_cleanup();major_init_failed: bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);bus_notifier_failed: bus_unregister(&usb_bus_type);bus_register_failed: usb_acpi_unregister(); usb_debugfs_cleanup();out: return retval;}
开发者ID:guribe94,项目名称:linux,代码行数:54,
示例19: vt8500_ehci_drv_probestatic int vt8500_ehci_drv_probe(struct platform_device *pdev){ struct usb_hcd *hcd; struct ehci_hcd *ehci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; /* * Right now device-tree probed devices don't get dma_mask set. * Since shared usb code relies on it, set it here for now. * Once we have dma capability bindings this can go away. */ if (!pdev->dev.dma_mask) pdev->dev.dma_mask = &vt8500_ehci_dma_mask; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ"); return -ENOMEM; } hcd = usb_create_hcd(&vt8500_ehci_hc_driver, &pdev->dev, "VT8500"); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (!hcd->regs) { pr_debug("ioremap failed"); ret = -ENOMEM; goto err1; } ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; }err1: usb_put_hcd(hcd); return ret;}
开发者ID:AllenDou,项目名称:linux,代码行数:51,
示例20: hiusb_ohci_hcd_drv_probestatic int hiusb_ohci_hcd_drv_probe(struct platform_device *pdev){ int ret; struct usb_hcd *hcd; if (usb_disabled()) return -ENODEV; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ/n"); return -ENOMEM; } hcd = usb_create_hcd(&hiusb_ohci_hc_driver, &pdev->dev, "hiusb-ohci"); if (!hcd) return -ENOMEM; hcd->rsrc_start = pdev->resource[0].start; hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed/n"); ret = -EBUSY; goto err1; } hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { pr_debug("ioremap failed/n"); ret = -ENOMEM; goto err2; } hiusb_start_hcd(); ohci_hcd_init(hcd_to_ohci(hcd)); ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED | IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; } hiusb_stop_hcd(); iounmap(hcd->regs);err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len);err1: usb_put_hcd(hcd); return ret;}
开发者ID:hmoster,项目名称:android_kernel,代码行数:51,
示例21: uhci_hcd_platform_probestatic int uhci_hcd_platform_probe(struct platform_device *pdev){ struct usb_hcd *hcd; struct uhci_hcd *uhci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; /* * Right now device-tree probed devices don't get dma_mask set. * Since shared usb code relies on it, set it here for now. * Once we have dma capability bindings this can go away. */ ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (ret) return ret; hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, pdev->name); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { ret = PTR_ERR(hcd->regs); goto err_rmr; } hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); uhci = hcd_to_uhci(hcd); uhci->regs = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret) goto err_rmr; device_wakeup_enable(hcd->self.controller); return 0;err_rmr: usb_put_hcd(hcd); return ret;}
开发者ID:19Dan01,项目名称:linux,代码行数:49,
示例22: cns3xxx_ehci_probestatic int cns3xxx_ehci_probe(struct platform_device *pdev){ struct device *dev = &pdev->dev; struct usb_hcd *hcd; const struct hc_driver *driver = &cns3xxx_ehci_hc_driver; struct resource *res; int irq; int retval; if (usb_disabled()) return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(dev, "Found HC with no IRQ./n"); return -ENODEV; } irq = res->start; hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(dev, "Found HC with no register addr./n"); retval = -ENODEV; goto err1; } hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (hcd->regs == NULL) { dev_dbg(dev, "error mapping memory/n"); retval = -EFAULT; goto err1; } retval = usb_add_hcd(hcd, irq, IRQF_SHARED); if (retval == 0) return retval;err1: usb_put_hcd(hcd); return retval;}
开发者ID:AllenDou,项目名称:linux,代码行数:49,
示例23: ohci_hcd_omap_drv_probestatic int ohci_hcd_omap_drv_probe(struct omap_dev *dev){ struct usb_hcd *hcd = NULL; int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_omap_probe(&ohci_omap_hc_driver, &hcd, dev); if (ret == 0) omap_set_drvdata(dev, hcd); return ret;}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:15,
示例24: ohci_pci_initstatic int __init ohci_pci_init(void){ if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "/n", hcd_name); ohci_init_driver(&ohci_pci_hc_driver, &pci_overrides);#ifdef CONFIG_PM /* Entries for the PCI suspend/resume callbacks are special */ ohci_pci_hc_driver.pci_suspend = ohci_suspend; ohci_pci_hc_driver.pci_resume = ohci_resume;#endif return pci_register_driver(&ohci_pci_driver);}
开发者ID:908626950,项目名称:linux,代码行数:17,
注:本文中的usb_disabled函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ usb_driver_claim_interface函数代码示例 C++ usb_detach_kernel_driver_np函数代码示例 |