本文整理汇总了C++中devfs_remove函数的典型用法代码示例。如果您正苦于以下问题:C++ devfs_remove函数的具体用法?C++ devfs_remove怎么用?C++ devfs_remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了devfs_remove函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mtd_notify_remove
static void mtd_notify_remove(struct mtd_info* mtd)
{
if (!mtd)
return;
devfs_remove("mtd/%d", mtd->index);
devfs_remove("mtd/%dro", mtd->index);
}
示例2: adc_exit
static void __exit adc_exit(void)
{
#ifdef CONFIG_DEVFS_FS
devfs_remove("adc/%d", 0);
devfs_remove("adc");
#endif
iounmap(peter_base_addr);
unregister_chrdev(adc_major,DEVICE_NAME);
printk("i am adc_exit, you see me, which means the module is rmmoved\n");
}
示例3: raw_exit
static void __exit raw_exit(void)
{
int i;
for (i = 1; i < MAX_RAW_MINORS; i++)
devfs_remove("raw/raw%d", i);
devfs_remove("raw/rawctl");
devfs_remove("raw");
cdev_del(&raw_cdev);
unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
}
示例4: cleanup_module
void cleanup_module(void)
{
/*
* Unregister the device
*/
devfs_remove("dvb/adapter0/frontend0");
class_simple_device_remove(MKDEV(DVB_MAJOR, 3));
devfs_remove("dvb");
class_simple_destroy(my_class);
cdev_del(&device_cdev);
unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), 64);
printk(KERN_INFO "[td-dvb-fe] unload successful\n");
}
示例5: ddi_remove_minor_node
void
ddi_remove_minor_node(dev_info_t *dip, char *name)
{
//printf("zvol: remove minor: '%s'\n", name ? name : "");
if (dip->devc) {
devfs_remove(dip->devc);
dip->devc = NULL;
}
if (dip->devb) {
devfs_remove(dip->devb);
dip->devb = NULL;
}
}
示例6: mtd_notify_remove
static void mtd_notify_remove(struct mtd_info* mtd)
{
if (!mtd)
return;
#ifdef CONFIG_DEVFS_FS
devfs_remove("mtd/%d", mtd->index);
devfs_remove("mtd/%dro", mtd->index);
#else
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
#endif
}
示例7: devfs_remove_disk
void devfs_remove_disk(struct gendisk *disk)
{
if (disk->minors != 1) {
devfs_remove("discs/disc%d", disk->number);
dealloc_unique_number(&disc_numspace, disk->number);
devfs_remove("%s/disc", disk->devfs_name);
}
if (disk->flags & GENHD_FL_CD) {
devfs_remove("cdroms/cdrom%d", disk->number);
dealloc_unique_number(&cdrom_numspace, disk->number);
}
devfs_remove(disk->devfs_name);
}
示例8: 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
}
示例9: bpp_cleanup
static void __exit bpp_cleanup(void)
{
unsigned idx;
for (idx = 0; idx < BPP_NO; idx++)
devfs_remove("bpp/%d", idx);
devfs_remove("bpp");
unregister_chrdev(BPP_MAJOR, dev_name);
for (idx = 0; idx < BPP_NO; idx++) {
if (instances[idx].present)
freeLptPort(idx);
}
}
示例10: ubi_free_volume
/**
* ubi_free_volume - free volume.
* @ubi: UBI device description object
* @vol: volume description object
*
* This function frees all resources for volume @vol but does not remove it.
* Used only when the UBI device is detached.
*/
void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
{
dbg_gen("free volume %d", vol->vol_id);
ubi->volumes[vol->vol_id] = NULL;
devfs_remove(&vol->cdev);
}
示例11: lpp_remove_one
static void lpp_remove_one (struct pci_dev *pdev)
{
DEV *dev = pci_get_drvdata(pdev);
dbg("%s(): dev=%08X pci_dev->vendor=%04X device=%04X",
__FUNCTION__, (uint)dev,
pdev->vendor, pdev->device);
if (!dev) BUG();
down (&minor_table_mutex);
#ifdef CONFIG_DEVFS_FS
devfs_remove("lpc/%d", dev->minor);
#endif
minor_table[dev->minor] = NULL;
// unregister_netdev(dev);
// iounmap(cp->regs);
pci_release_regions(pdev);
pci_clear_mwi(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
tasklet_kill(&dev->Dpc);
kfree(dev);
info(DRIVER_DESC " " DRIVER_DEV_NAME "%d now disconnected", dev->minor);
up (&minor_table_mutex);
}
示例12: uif_init
/**
* uif_init - initialize user interfaces for an UBI device.
* @ubi: UBI device description object
* @ref: set to %1 on exit in case of failure if a reference to @ubi->dev was
* taken, otherwise set to %0
*
* This function initializes various user interfaces for an UBI device. If the
* initialization fails at an early stage, this function frees all the
* resources it allocated, returns an error, and @ref is set to %0. However,
* if the initialization fails after the UBI device was registered in the
* driver core subsystem, this function takes a reference to @ubi->dev, because
* otherwise the release function ('dev_release()') would free whole @ubi
* object. The @ref argument is set to %1 in this case. The caller has to put
* this reference.
*
* This function returns zero in case of success and a negative error code in
* case of failure.
*/
static int uif_init(struct ubi_device *ubi, int *ref)
{
int i, err;
*ref = 0;
sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num);
err = ubi_cdev_add(ubi);
if (err) {
ubi_err("cannot add character device");
goto out_unreg;
}
for (i = 0; i < ubi->vtbl_slots; i++)
if (ubi->volumes[i]) {
err = ubi_add_volume(ubi, ubi->volumes[i]);
if (err) {
ubi_err("cannot add volume %d", i);
goto out_volumes;
}
}
return 0;
out_volumes:
kill_volumes(ubi);
devfs_remove(&ubi->cdev);
out_unreg:
ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err);
return err;
}
示例13: miiphy_remove
static void miiphy_remove(struct device_d *dev)
{
struct miiphy_device *mdev = dev->priv;
free(mdev->cdev.name);
devfs_remove(&mdev->cdev);
}
示例14: dsp56k_cleanup_driver
static void __exit dsp56k_cleanup_driver(void)
{
class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0));
class_simple_destroy(dsp56k_class);
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
devfs_remove("dsp56k");
}
示例15: usb_deregister_dev
/**
* usb_deregister_dev - deregister a USB device's dynamic minor.
* @intf: pointer to the usb_interface that is being deregistered
* @class_driver: pointer to the usb_class_driver for this device
*
* Used in conjunction with usb_register_dev(). This function is called
* when the USB driver is finished with the minor numbers gotten from a
* call to usb_register_dev() (usually when the device is disconnected
* from the system.)
*
* This function also cleans up the devfs file for the usb device, if devfs
* is enabled, and removes the usb class device from the sysfs tree.
*
* This should be called by all drivers that use the USB major number.
*/
void usb_deregister_dev(struct usb_interface *intf,
struct usb_class_driver *class_driver)
{
int minor_base = class_driver->minor_base;
char name[BUS_ID_SIZE];
#ifdef CONFIG_USB_DYNAMIC_MINORS
minor_base = 0;
#endif
if (intf->minor == -1)
return;
dbg ("removing %d minor", intf->minor);
spin_lock (&minor_lock);
usb_minors[intf->minor] = NULL;
spin_unlock (&minor_lock);
snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
devfs_remove (name);
class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
intf->class_dev = NULL;
intf->minor = -1;
}