在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(...
@@ -619,22 +625,28 @@ static irqreturn_t talitos_interrupt_##name(int irq, void *data) \ struct device *dev = data; \ struct talitos_private *priv = dev_get_drvdata(dev); \ u32 isr, isr_lo; \ unsigned long flags; \ ...
struct titsc *ts_dev = dev_get_drvdata(dev); @@ -543,7 +543,7 @@ static int __maybe_unused titsc_resume(struct device *dev) return 0; } static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); static DEFINE_SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, tit...
struct ci_hdrc *ci = dev_get_drvdata(dev); @@ -1446,7 +1450,7 @@ static int ci_resume(struct device *dev) ci_role(ci)->resume(ci, power_lost); if (power_lost) ci_handle_power_lost(ci); queue_work(system_freezable_wq, &ci->power_lost_work); if (ci->supports_runtime_pm...
adata = dev_get_drvdata(&child); if (adata) acp_enable_interrupts(adata);if (chip->chip_pdev) {child = chip->chip_pdev->dev; adata = dev_get_drvdata(&child); if (adata) acp_enable_interrupts(adata); } return ret; }0
add_class_attrs(class_get(cls));{ class_create_file(cls, &cls->class_attrs[i]);{ sysfs_create_file(&cls->p->subsys.kobj, &attr->attr); } } } } } device_create(structclass*class,structdevice *parent, dev_t devt,void*drvdata,constchar*fmt, ...);//函数原型 ...
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct wm8994 *control = dev_get_drvdata(component->dev->parent); int i; if (control->type != WM8958) return 0; switch (event) { case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_PRE_PMU:2...
struct spidev_data *spidev = spi_get_drvdata(spi);//根据spi设备获取spidev_data spin_lock_irq(&spidev->spi_lock);//上自旋锁 spidev->spi = NULL;//清空spidev_data->spi指针 spi_set_drvdata(spi, NULL);//spi->dev->p->driver_data=NULL ...
struct Scsi_Host *instance = zorro_get_drvdata(z); struct a2091_hostdata *hdata = shost_priv(instance); @@ -251,7 +250,7 @@ static void __devexit a2091_remove(struct zorro_dev *z) release_mem_region(z->resource.start, 256); } static struct zorro_device_id a2091_zorro_tbl[]...