?????????????????????
struct device_driver {
const char *name;/*?????????????*/
struct bus_type *bus;/*?????????????????*/
struct module *owner;
const char *mod_name; /* used for built-in modules */
bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
#if defined(CONFIG_OF)
const struct of_device_id *of_match_table;
#endif
int (*probe) (struct device *dev);/*???????????*/
int (*remove) (struct device *dev);
void (*shutdown) (struct device *dev);
int (*suspend) (struct device *dev?? pm_message_t state);
int (*resume) (struct device *dev);
const struct attribute_group **groups;
const struct dev_pm_ops *pm;
struct driver_private *p;
};
?????豸???????
????driver_register(struct device_driver *drv);
?????豸???????
????driver_unregister(struct device_driver *drv);
????????????????????
struct driver_attribute {
struct attribute attr;
ssize_t (*show)(struct device_driver *driver?? char *buf);//????????????
ssize_t (*store)(struct device_driver *driver?? const char *buf??
size_t count);//д?????? ????????
};
???????????????????????????????????????????
#define DRIVER_ATTR(_name?? _mode?? _show?? _store)////////???????????壺
struct driver_attribute driver_attr_##_name =  //???? ??????????? ?????????driver_attr_name?????????
__ATTR(_name?? _mode?? _show?? _store)//
????????????????????
????driver_create_file(struct device_driver *driver??const struct driver_attribute *attr);//?????? ??????? ???????????????壬??????????????????