博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spmi_bus
阅读量:7023 次
发布时间:2019-06-28

本文共 2004 字,大约阅读时间需要 6 分钟。

hot3.png

723 struct bus_type spmi_bus_type = {724         .name           = "spmi",725         .match          = spmi_device_match,726         .pm             = &spmi_pm_ops,727 };632 static int spmi_device_match(struct device *dev, struct device_driver *drv)633 {634         struct spmi_device *spmi_dev;635         struct spmi_driver *sdrv = to_spmi_driver(drv);636 637         if (dev->type == &spmi_dev_type)638                 spmi_dev = to_spmi_device(dev);639         else640                 return 0;641 642         /* Attempt an OF style match */643         if (of_driver_match_device(dev, drv))644                 return 1;645 646         if (sdrv->id_table)647                 return spmi_match(sdrv->id_table, spmi_dev) != NULL;648 649         if (drv->name)650                 return strncmp(spmi_dev->name, drv->name, SPMI_NAME_SIZE) == 0;651         return 0;652 }653  17 /** 18  * of_driver_match_device - Tell if a driver's of_match_table matches a device. 19  * @drv: the device_driver structure to test 20  * @dev: the device structure to match against 21  */ 22 static inline int of_driver_match_device(struct device *dev, 23                                          const struct device_driver *drv) 24 { 25         return of_match_device(drv->of_match_table, dev) != NULL; 26 }  11 #include "of_private.h" 12  13 /** 14  * of_match_device - Tell if a struct device matches an of_device_id list 15  * @ids: array of of device match structures to search in 16  * @dev: the of device structure to match against 17  * 18  * Used by a driver to check whether an platform_device present in the 19  * system is in its list of supported devices. 20  */ 21 const struct of_device_id *of_match_device(const struct of_device_id *matches, 22                                            const struct device *dev) 23 { 24         if ((!matches) || (!dev->of_node)) 25                 return NULL; 26         return of_match_node(matches, dev->of_node); 27 }

转载于:https://my.oschina.net/tplinuxhyh/blog/534738

你可能感兴趣的文章
[从hzwer神犇那翻到的模拟赛题] 合唱队形
查看>>
Bzoj3653 谈笑风生
查看>>
定制化WinPE
查看>>
C++ Template Metaprogramming.Chapter 1
查看>>
VUE中引入vue-awesome-swiper 不自动播放的问题
查看>>
linux在二进制文件中查找pattern的offset
查看>>
【洛谷 p3373】模板-线段树 2(数据结构--线段树)
查看>>
回忆之浮窗
查看>>
js实现光标位置置后
查看>>
jquery中的全选,全不选
查看>>
ln -s 使用
查看>>
PYTHON-文件指针的移动,移动和函数基础
查看>>
ajax 跳转页面时添加header
查看>>
spring + Mybatis + pageHelper + druid 整合源码分享
查看>>
使用Visual Studio将C#生成DLL文件的方法
查看>>
设计模式值六大原则——依赖倒置原则 (DIP)
查看>>
List的基本操作实战与基于模式匹配的List排序算法实现之Scala学习笔记-23
查看>>
各类型的sizeof()值
查看>>
[LeetCode] Flatten Binary Tree to Linked List 解题报告
查看>>
Latex 写算法伪代码
查看>>