• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pnp_register_driver函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pnp_register_driver函数的典型用法代码示例。如果您正苦于以下问题:C++ pnp_register_driver函数的具体用法?C++ pnp_register_driver怎么用?C++ pnp_register_driver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pnp_register_driver函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cmos_init

static int __init cmos_init(void)
{
	int retval = 0;

#ifdef	CONFIG_PNP
	retval = pnp_register_driver(&cmos_pnp_driver);
	if (retval == 0)
		pnp_driver_registered = true;
#endif

	if (!cmos_rtc.dev) {
		retval = platform_driver_probe(&cmos_platform_driver,
					       cmos_platform_probe);
		if (retval == 0)
			platform_driver_registered = true;
	}

	dmi_check_system(rtc_quirks);

	if (retval == 0)
		return 0;

#ifdef	CONFIG_PNP
	if (pnp_driver_registered)
		pnp_unregister_driver(&cmos_pnp_driver);
#endif
	return retval;
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:28,代码来源:rtc-cmos.c


示例2: generic_NCR5380_init

static int __init generic_NCR5380_init(void)
{
	int ret = 0;

	/* compatibility with old-style parameters */
	if (irq[0] == -1 && base[0] == 0 && card[0] == -1) {
		irq[0] = ncr_irq;
		base[0] = ncr_addr;
		if (ncr_5380)
			card[0] = BOARD_NCR5380;
		if (ncr_53c400)
			card[0] = BOARD_NCR53C400;
		if (ncr_53c400a)
			card[0] = BOARD_NCR53C400A;
		if (dtc_3181e)
			card[0] = BOARD_DTC3181E;
		if (hp_c2502)
			card[0] = BOARD_HP_C2502;
	}

#ifdef CONFIG_PNP
	if (!pnp_register_driver(&generic_NCR5380_pnp_driver))
		pnp_registered = 1;
#endif
	ret = isa_register_driver(&generic_NCR5380_isa_driver, MAX_CARDS);
	if (!ret)
		isa_registered = 1;

	return (pnp_registered || isa_registered) ? 0 : ret;
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:30,代码来源:g_NCR5380.c


示例3: rtcan_peak_dng_init

/** Init module */
static int __init rtcan_peak_dng_init(void)
{
    int i, ret = -EINVAL, done = 0;

    if (pnp_register_driver(&rtcan_peak_dng_pnp_driver) == 0)
	pnp_registered = 1;

    for (i = 0;
	 i < RTCAN_PEAK_DNG_MAX_DEV && type[i] != 0;
	 i++) {

	if ((ret = rtcan_peak_dng_init_one(i)) != 0) {
	    printk(KERN_ERR "%s: Init failed with %d\n", RTCAN_DRV_NAME, ret);
	    goto cleanup;
	}
	done++;
    }
    if (done)
	return 0;

    printk(KERN_ERR "%s: Please specify type=epp or type=sp\n",
	   RTCAN_DRV_NAME);

cleanup:
    rtcan_peak_dng_exit();
    return ret;
}
开发者ID:BhargavKola,项目名称:xenomai-forge,代码行数:28,代码来源:rtcan_peak_dng.c


示例4: pnpide_init

void pnpide_init(int enable)
{
	if(enable)
		pnp_register_driver(&idepnp_driver);
	else
		pnp_unregister_driver(&idepnp_driver);
}
开发者ID:wxlong,项目名称:Test,代码行数:7,代码来源:ide-pnp.c


示例5: c2_init

/* Initialization */
int c2_init(void)
{
  /* Register the character device (at least try) */
  Major = register_chrdev(major,
                          DEVICE_NAME,
                          &Fops);
  /* Negative values signify an error */
  if (Major < 0) {
    printk (KERN_ERR
       "cygnal_c2: Failed to register character device with major %d\n",
        Major);
    return Major;
  }

#ifdef USE_PNP
  if (pnp_register_driver(&c2_pnp_driver) < 0) {
    unregister_chrdev(Major, DEVICE_NAME);
    return -ENODEV;
  }
#else
  request_region(io_base,0x10,DEVICE_NAME);
  if (request_irq(irq, c2_interrupt, SA_INTERRUPT, DEVICE_NAME, NULL)) {
    printf("<1>Requesting IRQ %d failed\n", irq);
    unregister_chrdev(Major, DEVICE_NAME);
    return -ENODEV;
  }
#endif
  if(major) Major=major; /* The register_chrdev returns "0" if
			    major number was given, and registration
			    is successfull */
  printk(KERN_INFO
     "cygnal_c2: Successfully registered major device number %d\n",
      Major);
  return 0;
}
开发者ID:GBert,项目名称:misc,代码行数:36,代码来源:cygnal_c2.c


示例6: c6xdigio_attach

static int c6xdigio_attach(struct comedi_device *dev,
			   struct comedi_devconfig *it)
{
	struct comedi_subdevice *s;
	int ret;

	ret = comedi_request_region(dev, it->options[0], C6XDIGIO_SIZE);
	if (ret)
		return ret;

	ret = comedi_alloc_subdevices(dev, 2);
	if (ret)
		return ret;

	/*  Make sure that PnP ports get activated */
	pnp_register_driver(&c6xdigio_pnp_driver);

	s = &dev->subdevices[0];
	/* pwm output subdevice */
	s->type = COMEDI_SUBD_AO;	/*  Not sure what to put here */
	s->subdev_flags = SDF_WRITEABLE;
	s->n_chan = 2;
	/*      s->trig[0] = c6xdigio_pwmo; */
	s->insn_read = c6xdigio_pwmo_insn_read;
	s->insn_write = c6xdigio_pwmo_insn_write;
	s->maxdata = 500;
	s->range_table = &range_bipolar10;	/*  A suitable lie */

	s = &dev->subdevices[1];
	/* encoder (counter) subdevice */
	s->type = COMEDI_SUBD_COUNTER;
	s->subdev_flags = SDF_READABLE | SDF_LSAMPL;
	s->n_chan = 2;
	/* s->trig[0] = c6xdigio_ei; */
	s->insn_read = c6xdigio_ei_insn_read;
	s->maxdata = 0xffffff;
	s->range_table = &range_unknown;

	/*	s = &dev->subdevices[2]; */
	/* pwm output subdevice */
	/*	s->type = COMEDI_SUBD_COUNTER;  // Not sure what to put here */
	/*	s->subdev_flags = SDF_WRITEABLE; */
	/*	s->n_chan = 1; */
	/*	s->trig[0] = c6xdigio_ei_init; */
	/*	s->insn_read = c6xdigio_ei_init_insn_read; */
	/*	s->insn_write = c6xdigio_ei_init_insn_write; */
	/*	s->maxdata = 0xFFFF;  // Really just a don't care */
	/*	s->range_table = &range_unknown; // Not sure what to put here */

	/*  I will call this init anyway but more than likely the DSP board */
	/*  will not be connected when device driver is loaded. */
	board_init(dev);

	return 0;
}
开发者ID:PKUCloud,项目名称:samsara-linux-3.11,代码行数:55,代码来源:c6xdigio.c


示例7: cmos_init

static int __init cmos_init(void)
{
#ifdef	CONFIG_PNP
	if (pnp_platform_devices)
		return pnp_register_driver(&cmos_pnp_driver);
	else
		return platform_driver_probe(&cmos_platform_driver,
			cmos_platform_probe);
#else
	return platform_driver_probe(&cmos_platform_driver,
			cmos_platform_probe);
#endif /* CONFIG_PNP */
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:13,代码来源:rtc-cmos.c


示例8: fmr2_init

static int __init fmr2_init(void)
{
    int ret;

    ret = pnp_register_driver(&fmr2_pnp_driver);
    if (!ret)
        pnp_registered = true;
    ret = isa_register_driver(&fmr2_isa_driver, 1);
    if (!ret)
        isa_registered = true;

    return (pnp_registered || isa_registered) ? 0 : ret;
}
开发者ID:Niisp,项目名称:MT6795.kernel,代码行数:13,代码来源:radio-sf16fmr2.c


示例9: hisax_fcpcipnp_init

static int __init hisax_fcpcipnp_init(void)
{
	int retval;

	printk(KERN_INFO "hisax_fcpcipnp: Fritz!Card PCI/PCIv2/PnP ISDN driver v0.0.1\n");

	retval = pci_register_driver(&fcpci_driver);
	if (retval)
		return retval;
#ifdef CONFIG_PNP
	retval = pnp_register_driver(&fcpnp_driver);
	if (retval < 0) {
		pci_unregister_driver(&fcpci_driver);
		return retval;
	}
#endif
	return 0;
}
开发者ID:1703011,项目名称:asuswrt-merlin,代码行数:18,代码来源:hisax_fcpcipnp.c


示例10: cmos_init

static int __init cmos_init(void)
{
	int retval = 0;

#ifdef	CONFIG_PNP
	pnp_register_driver(&cmos_pnp_driver);
#endif

	if (!cmos_rtc.dev)
		retval = platform_driver_register(&cmos_platform_driver);

	if (retval == 0)
		return 0;

#ifdef	CONFIG_PNP
	pnp_unregister_driver(&cmos_pnp_driver);
#endif
	return retval;
}
开发者ID:zhoupeng,项目名称:spice4xen,代码行数:19,代码来源:rtc-cmos.c


示例11: rtapi_app_main

int rtapi_app_main(void) {
    int r;

    comp_id = hal_init("probe_parport");
    if (comp_id < 0) {
        rtapi_print_msg(RTAPI_MSG_ERR, "PROBE_PARPORT: ERROR: hal_init() failed\n");
        return -1;
    }


    r = pnp_register_driver (&parport_pc_pnp_driver);
    if (r >= 0) {
        pnp_registered_parport = 1;
    } else {
        rtapi_print_msg(RTAPI_MSG_WARN, "PROBE_PARPORT: no PnPBIOS parports were detected (%d)\n", r);
    }

    hal_ready(comp_id);
    return 0;
}
开发者ID:chrmorais,项目名称:miniemc2,代码行数:20,代码来源:probe_parport.c


示例12: alsa_card_mpu401_init

static int __init alsa_card_mpu401_init(void)
{
	int i, err;

	if ((err = platform_driver_register(&snd_mpu401_driver)) < 0)
		return err;

	for (i = 0; i < SNDRV_CARDS; i++) {
		struct platform_device *device;
		if (! enable[i])
			continue;
#ifdef CONFIG_PNP
		if (pnp[i])
			continue;
#endif
		device = platform_device_register_simple(SND_MPU401_DRIVER,
							 i, NULL, 0);
		if (IS_ERR(device))
			continue;
		if (!platform_get_drvdata(device)) {
			platform_device_unregister(device);
			continue;
		}
		platform_devices[i] = device;
		snd_mpu401_devices++;
	}
	err = pnp_register_driver(&snd_mpu401_pnp_driver);
	if (!err)
		pnp_registered = 1;

	if (!snd_mpu401_devices) {
#ifdef MODULE
		printk(KERN_ERR "MPU-401 device not found or device busy\n");
#endif
		snd_mpu401_unregister_all();
		return -ENODEV;
	}
	return 0;
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:39,代码来源:mpu401.c


示例13: isapnp_init

static int __init isapnp_init(void)
{
	return pnp_register_driver(&isapnp_driver);
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:4,代码来源:pata_isapnp.c


示例14: sc1200wdt_init

static int __init sc1200wdt_init(void)
{
	int ret;

	printk(KERN_INFO "%s\n", banner);

#if defined CONFIG_PNP
	if (isapnp) {
		ret = pnp_register_driver(&scl200wdt_pnp_driver);
		if (ret)
			goto out_clean;
	}
#endif

	if (io == -1) {
		printk(KERN_ERR PFX "io parameter must be specified\n");
		ret = -EINVAL;
		goto out_pnp;
	}

#if defined CONFIG_PNP
	/* now that the user has specified an IO port and we haven't detected
	 * any devices, disable pnp support */
	isapnp = 0;
	pnp_unregister_driver(&scl200wdt_pnp_driver);
#endif

	if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
		printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
		ret = -EBUSY;
		goto out_pnp;
	}

	ret = sc1200wdt_probe();
	if (ret)
		goto out_io;

	ret = register_reboot_notifier(&sc1200wdt_notifier);
	if (ret) {
		printk(KERN_ERR PFX
			"Unable to register reboot notifier err = %d\n", ret);
		goto out_io;
	}

	ret = misc_register(&sc1200wdt_miscdev);
	if (ret) {
		printk(KERN_ERR PFX
			"Unable to register miscdev on minor %d\n",
							WATCHDOG_MINOR);
		goto out_rbt;
	}

	/* ret = 0 */

out_clean:
	return ret;

out_rbt:
	unregister_reboot_notifier(&sc1200wdt_notifier);

out_io:
	release_region(io, io_len);

out_pnp:
#if defined CONFIG_PNP
	if (isapnp)
		pnp_unregister_driver(&scl200wdt_pnp_driver);
#endif
	goto out_clean;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:70,代码来源:sc1200wdt.c


示例15: pnpide_init

static int __init pnpide_init(void)
{
	return pnp_register_driver(&idepnp_driver);
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:4,代码来源:ide-pnp.c


示例16: sb1000_init

static int __init
sb1000_init(void)
{
	return pnp_register_driver(&sb1000_driver);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:5,代码来源:sb1000.c


示例17: ite_init

static int ite_init(void)
{
	return pnp_register_driver(&ite_driver);
}
开发者ID:AiWinters,项目名称:linux,代码行数:4,代码来源:ite-cir.c


示例18: fintek_init

static int __init fintek_init(void)
{
	return pnp_register_driver(&fintek_driver);
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:4,代码来源:fintek-cir.c


示例19: apple_gmux_init

static int __init apple_gmux_init(void)
{
	return pnp_register_driver(&gmux_pnp_driver);
}
开发者ID:AmesianX,项目名称:netlink-mmap,代码行数:4,代码来源:apple-gmux.c


示例20: cmos_init

static int __init cmos_init(void)
{
	return pnp_register_driver(&cmos_pnp_driver);
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:4,代码来源:rtc-cmos.c



注:本文中的pnp_register_driver函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pnp_set_logical_device函数代码示例发布时间:2022-05-30
下一篇:
C++ pnp_port_start函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap