本文整理汇总了C++中devfs_unregister函数的典型用法代码示例。如果您正苦于以下问题:C++ devfs_unregister函数的具体用法?C++ devfs_unregister怎么用?C++ devfs_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了devfs_unregister函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scull_cleanup_module
/*
* The cleanup function is used to handle initialization failures as well.
* Thefore, it must be careful to work correctly even if some of the items
* have not been initialized
*/
void scull_cleanup_module(void)
{
int i;
#ifndef CONFIG_DEVFS_FS
/* cleanup_module is never called if registering failed */
unregister_chrdev(scull_major, "scull");
#endif
scull_remove_proc();
if (scull_devices) {
for (i=0; i<scull_nr_devs; i++) {
scull_trim(scull_devices+i);
/* the following line is only used for devfs */
devfs_unregister(scull_devices[i].handle);
}
kfree(scull_devices);
}
/* and call the cleanup functions for friend devices */
scull_p_cleanup();
scull_access_cleanup();
/* once again, only for devfs */
devfs_unregister(scull_devfs_dir);
}
示例2: scull_access_cleanup
/*
* This is called by cleanup_module or on failure.
* It is required to never fail, even if nothing was initialized first
*/
void scull_access_cleanup(void)
{
struct scull_listitem *lptr, *prev;
scull_trim(&scull_s_device); /* disallocate it */
scull_trim(&scull_u_device); /* disallocate it */
scull_trim(&scull_w_device); /* disallocate it */
/* all the cloned devices */
prev=NULL;
for (lptr = scull_c_head; lptr; lptr = lptr->next) {
scull_trim(&(lptr->device));
if (prev) kfree(prev);
prev=lptr;
}
if (prev) kfree(prev);
scull_c_head = NULL; /* overkill: we're unloading anyways */
/* remove devfs entry points */
devfs_unregister(scull_s_device.handle);
devfs_unregister(scull_u_device.handle);
devfs_unregister(scull_w_device.handle);
devfs_unregister(scull_priv_handle);
return;
}
示例3: lvm_fs_remove_vg
void lvm_fs_remove_vg(vg_t *vg_ptr) {
int i;
if (!vg_ptr)
return;
devfs_unregister(ch_devfs_handle[vg_ptr->vg_number]);
ch_devfs_handle[vg_ptr->vg_number] = NULL;
/* remove lv's */
for(i = 0; i < vg_ptr->lv_max; i++)
if(vg_ptr->lv[i]) lvm_fs_remove_lv(vg_ptr, vg_ptr->lv[i]);
/* must not remove directory before leaf nodes */
devfs_unregister(vg_devfs_handle[vg_ptr->vg_number]);
vg_devfs_handle[vg_ptr->vg_number] = NULL;
/* remove pv's */
for(i = 0; i < vg_ptr->pv_max; i++)
if(vg_ptr->pv[i]) lvm_fs_remove_pv(vg_ptr, vg_ptr->pv[i]);
if(vg_ptr->vg_dir_pde) {
remove_proc_entry(LVM_LV_SUBDIR, vg_ptr->vg_dir_pde);
vg_ptr->lv_subdir_pde = NULL;
remove_proc_entry(LVM_PV_SUBDIR, vg_ptr->vg_dir_pde);
vg_ptr->pv_subdir_pde = NULL;
remove_proc_entry("group", vg_ptr->vg_dir_pde);
vg_ptr->vg_dir_pde = NULL;
remove_proc_entry(vg_ptr->vg_name, lvm_proc_vg_subdir);
}
}
示例4: mtd_notify_remove
static void mtd_notify_remove(struct mtd_info* mtd)
{
if (!mtd)
return;
devfs_unregister(devfs_rw_handle[mtd->index]);
devfs_unregister(devfs_ro_handle[mtd->index]);
}
示例5: gpio_exit
static void __exit
gpio_exit(void)
{
int i;
for (i = 0; i < ARRAYSIZE(gpio_file); i++)
devfs_unregister(gpio_file[i].handle);
devfs_unregister(gpio_dir);
devfs_unregister_chrdev(gpio_major, "gpio");
sb_detach(gpio_sbh);}
示例6: fpga_exit
void __exit fpga_exit(void)
{
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_fpgaraw);
devfs_unregister(devfs_fpga_dir);
#endif
unregister_chrdev(fpgaMajor, DEVICE_NAME);
}
示例7: s3c2410_adc_exit
void __exit s3c2410_adc_exit(void)
{
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_adcraw);
devfs_unregister(devfs_adc_dir);
#endif
unregister_chrdev(adcMajor, DEVICE_NAME);
free_irq(IRQ_ADC_DONE, NULL);
}
示例8: s3c2410_kbd_exit
static void __exit s3c2410_kbd_exit(void)
{
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_kbdraw);
devfs_unregister(devfs_kbd_dir);
#endif
unregister_chrdev(kbdMajor, DEVICE_NAME);
free_irq(IRQ_KBD, s3c2410_isr_kbd);
}
示例9: s3c2410_ts_exit
static void __exit s3c2410_ts_exit(void)
{
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_tsraw);
devfs_unregister(devfs_ts_dir);
#endif
unregister_chrdev(tsMajor, DEVICE_NAME);
#ifdef CONFIG_PM
pm_unregister(tsdev.pm_dev);
#endif
free_irq(IRQ_ADC_DONE, s3c2410_isr_adc);
free_irq(IRQ_TC, s3c2410_isr_tc);
}
示例10: devfs_unregister_card
static void devfs_unregister_card(struct em84xx *card)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
devfs_unregister(em8300_handle[0]);
devfs_unregister(em8300_handle[1]);
devfs_unregister(em8300_handle[2]);
devfs_unregister(em8300_handle[3]);
#else
devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 0);
devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 1);
devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 2);
devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 3);
#endif
}
示例11: camera_disconnect
static void camera_disconnect(struct usb_device *dev, void *ptr)
{
struct camera_state *camera = (struct camera_state *) ptr;
int subminor = camera->subminor;
down (&state_table_mutex);
down (&camera->sem);
devfs_unregister(camera->devfs);
/* If camera's not opened, we can clean up right away.
* Else apps see a disconnect on next I/O; the release cleans.
*/
if (!camera->buf) {
minor_data [subminor] = NULL;
kfree (camera);
camera = NULL;
} else
camera->dev = NULL;
info ("USB Camera #%d disconnected", subminor);
usb_dec_dev_use (dev);
if (camera != NULL)
up (&camera->sem);
up (&state_table_mutex);
}
示例12: disconnect_scanner
static void
disconnect_scanner(struct usb_device *dev, void *ptr)
{
struct scn_usb_data *scn = (struct scn_usb_data *) ptr;
down (&scn_mutex);
down (&(scn->sem));
if(scn->intr_ep) {
dbg("disconnect_scanner(%d): Unlinking IRQ URB", scn->scn_minor);
usb_unlink_urb(&scn->scn_irq);
}
usb_driver_release_interface(&scanner_driver,
&scn->scn_dev->actconfig->interface[scn->ifnum]);
kfree(scn->ibuf);
kfree(scn->obuf);
dbg("disconnect_scanner: De-allocating minor:%d", scn->scn_minor);
devfs_unregister(scn->devfs);
p_scn_table[scn->scn_minor] = NULL;
up (&(scn->sem));
kfree (scn);
up (&scn_mutex);
}
示例13: ipmi_smi_gone
static void ipmi_smi_gone(int if_num)
{
if (if_num > MAX_DEVICES)
return;
devfs_unregister(handles[if_num]);
}
示例14: skel_disconnect
/**
* skel_disconnect
*
* Called by the usb core when the device is removed from the system.
*/
static void skel_disconnect(struct usb_device *udev, void *ptr)
{
struct usb_skel *dev;
int minor;
dev = (struct usb_skel *)ptr;
down (&minor_table_mutex);
down (&dev->sem);
minor = dev->minor;
/* remove our devfs node */
devfs_unregister(dev->devfs);
/* if the device is not opened, then we clean up right now */
if (!dev->open_count) {
up (&dev->sem);
skel_delete (dev);
} else {
dev->udev = NULL;
up (&dev->sem);
}
info("USB Skeleton #%d now disconnected", minor);
up (&minor_table_mutex);
}
示例15: init_module
int __init
init_module(void)
{
int rc;
/* Get our definition */
_gmodule = gmodule_get();
if(!_gmodule) return -ENODEV;
/* Register ourselves */
#ifdef GMODULE_CONFIG_DEVFS_FS
devfs_handle = devfs_register(NULL,
_gmodule->name,
DEVFS_FL_NONE,
_gmodule->major,
_gmodule->minor,
S_IFCHR | S_IRUGO | S_IWUGO,
&_gmodule_fops,
NULL);
if(!devfs_handle) {
printk(KERN_WARNING "%s: can't register device with devfs",
_gmodule->name);
}
rc = 0;
#else
rc = register_chrdev(_gmodule->major,
_gmodule->name,
&_gmodule_fops);
if (rc < 0) {
printk(KERN_WARNING "%s: can't get major %d",
_gmodule->name, _gmodule->major);
return rc;
}
if(_gmodule->major == 0) {
_gmodule->major = rc;
}
#endif
/* Specific module Initialization */
if(_gmodule->init) {
int rc;
if((rc = _gmodule->init()) < 0) {
#ifdef GMODULE_CONFIG_DEVFS_FS
if(devfs_handle) devfs_unregister(devfs_handle);
#else
unregister_chrdev(_gmodule->major, _gmodule->name);
#endif
return rc;
}
}
/* Add a /proc entry, if valid */
if(_gmodule->pprint) {
_gmodule_create_proc();
}
return 0; /* succeed */
}