作家
登录

Linux平台总线驱动设备模型

作者: 来源: 2017-11-16 16:05:49 阅读 我要评论

  •             struct resource *r = &pdev->resource[i];   
  •             unsigned long type = resource_type(r);   
  •    
  •             if (type == IORESOURCE_MEM || type == IORESOURCE_IO)   
  •                 release_resource(r);   
  •         }   
  •     }   
  • }   
  • platform_driver的定义:

    device_driver的定义:

    1. struct platform_driver {   
    2.     int (*probe)(struct platform_device *);   
    3.     int (*remove)(struct platform_device *);   
    4.     void (*shutdown)(struct platform_device *);   
    5.     int (*suspend)(struct platform_device *, pm_message_t state);   
    6.     int (*resume)(struct platform_device *);   
    7.     struct device_driver driver;   
    8.     const struct platform_device_id *id_table;   
    9. };   
    1. struct device_driver {   
    2.     const char      *name;   
    3.     struct bus_type     *bus;   
    4.    
    5.     struct module       *owner;   
    6.     const char      *mod_name;  /* used for built-in modules */   
    7.    
    8.     bool suppress_bind_attrs;   /* disables bind/unbind via sysfs */   
    9.    
    10.     const struct of_device_id   *of_match_table;   
    11.     const struct acpi_device_id *acpi_match_table;   
    12.    
    13.     int (*probe) (struct device *dev);   
    14.     int (*remove) (struct device *dev);   
    15.     void (*shutdown) (struct device *dev);   
    16.     int (*suspend) (struct device *dev, pm_message_t state);   
    17.     int (*resume) (struct device *dev);   
    18.     const struct attribute_group **groups;   
    19.    
    20.     const struct dev_pm_ops *pm;   

        推荐阅读

        Linux Lite第一个支持Linux 4.14及如何安装

      Tech Neo技巧沙龙 | 11月25号,九州云/ZStack与您一路商量云时代收集界线治理实践 Linux Lite保护者Jerry Bezencon再次初次在Twitter上宣布他的基于Ubuntu的发行版的软件库中最新的Linux内>>>详细阅读


      本文标题:Linux平台总线驱动设备模型

      地址:http://www.17bianji.com/lsqh/38937.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)