在linux 内核编程中,会经常见到一个宏函数container_of(ptr,type,member), 但是当你通过追踪源码时,...
IS_ERR_OR_NULL(res->mac)) 4454 memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN); 4455 4456 dev_set_drvdata(device, priv->dev); 4457 4458 /* Verify driver arguments */ 4459 stmmac_verify_args(); 4460 4461 /* Allocate workqueue */ 4462 priv->wq = create_singlethread_workqueue(...
spi_set_drvdata(spi, spidev);//spi->dev->p->driver_data=spidev else kfree(spidev); return status; } staticint __devexit spidev_remove(struct spi_device *spi) { struct spidev_data *spidev = spi_get_drvdata(spi);//根据spi设备获取spidev_data spin_lock_irq(&spidev->spi_lock);...
sdio_set_drvdata(func, card); lbs_add_card(card, &func->dev); /* Allocate an Ethernet device and register it */ lbs_cfg_alloc // 分配一个无线网络设备结构体,并初始化 wdev = kzalloc(sizeof(struct wire wdev->wiphy = wiphy_new(&lbs_cfg80211_ops, sizeof( lbs_init_adapter // init...
(ndev); db->dev = &pdev->dev; db->ndev = ndev; mac = of_get_mac_address(np);//设置mac...= ðps_netdev_ops; ndev->watchdog_timeo = msecs_to_jiffies(watchdog); ndev->ethtool_ops = &...ethps_ethtool_ops; platform_set_drvdata(pdev, ndev); ret = register_netdev...
ret = request_irq((unsigned int)cirq, (irq_handler_t)mt6573_sd_cd_irq, 0, DRV_NAME, host); if (ret) goto free_irq; } } 这一段是热插拔识别SD卡的重要函数,做热插拔这里必须实现。 platform_set_drvdata(pdev, mmc); //把mmc的数据挂到pdev私有数据下 ...
video_set_drvdata(dev->vfd, dev); } } 该函数中出现一个config_a_device(dev)函数,这个函数是video_device设备的初始化配置函数,包括对文件操作指针的赋值,这里是一个初始化封装。 先来看看v4l2_detect()函数: structcamera_sensor *v4l2_detect(structacq_device_t *dev) ...
浅析ASoC-audio驱动oss框架下_dev_dsp与alsa框架下设备节点打开和创建简易流程 -
set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks); }if(id->driver_info & BTUSB_BROKEN_ISOC) data->isoc =NULL;if(id->driver_info & BTUSB_DIGIANSWER) { data->cmdreq_type = USB_TYPE_VENDOR; set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks); ...
dev_set_drvdata(&ofdev->dev,NULL); of_node_put(fpi->phy_node); out_free_fpi: kfree(fpi);returnret; } 开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:101,代码来源:fs_enet-main.c 示例8: virtnet_probe ▲点赞 1▼ ...