MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pci_procfs_attach

Function pci_procfs_attach

components/drivers/pci/procfs.c:257–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255};
256
257void pci_procfs_attach(struct rt_pci_device *pdev)
258{
259 const char *name;
260 struct proc_dentry *dentry;
261
262 if (!pci_proc_dentry)
263 {
264 return;
265 }
266
267 name = rt_dm_dev_get_name(&pdev->parent);
268 dentry = proc_create_data(name, 0644, pci_proc_dentry, &pci_fops, pdev);
269
270 if (!dentry)
271 {
272 LOG_E("Create %s file fail", name);
273 return;
274 }
275 proc_release(dentry);
276}
277
278void pci_procfs_detach(struct rt_pci_device *pdev)
279{

Callers

nothing calls this directly

Calls 3

rt_dm_dev_get_nameFunction · 0.85
proc_create_dataFunction · 0.85
proc_releaseFunction · 0.85

Tested by

no test coverage detected