Lines Matching refs:dev
130 int (*match)(struct device *dev, struct device_driver *drv);
131 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
132 int (*probe)(struct device *dev);
133 void (*sync_state)(struct device *dev);
134 int (*remove)(struct device *dev);
135 void (*shutdown)(struct device *dev);
137 int (*online)(struct device *dev);
138 int (*offline)(struct device *dev);
140 int (*suspend)(struct device *dev, pm_message_t state);
141 int (*resume)(struct device *dev);
143 int (*num_vf)(struct device *dev);
145 int (*dma_configure)(struct device *dev);
175 int device_match_name(struct device *dev, const void *name);
176 int device_match_of_node(struct device *dev, const void *np);
177 int device_match_fwnode(struct device *dev, const void *fwnode);
178 int device_match_devt(struct device *dev, const void *pdevt);
179 int device_match_acpi_dev(struct device *dev, const void *adev);
180 int device_match_any(struct device *dev, const void *unused);
183 int (*fn)(struct device *dev, void *data));
186 int (*match)(struct device *dev, const void *data));
396 int (*probe) (struct device *dev);
397 void (*sync_state)(struct device *dev);
398 int (*remove) (struct device *dev);
399 void (*shutdown) (struct device *dev);
400 int (*suspend) (struct device *dev, pm_message_t state);
401 int (*resume) (struct device *dev);
406 void (*coredump) (struct device *dev);
444 int (*fn)(struct device *dev,
448 int (*match)(struct device *dev, const void *data));
527 void driver_deferred_probe_add(struct device *dev);
528 int driver_deferred_probe_check_state(struct device *dev);
529 int driver_deferred_probe_check_state_continue(struct device *dev);
548 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
549 void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
597 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
598 char *(*devnode)(struct device *dev, umode_t *mode);
601 void (*dev_release)(struct device *dev);
603 int (*shutdown_pre)(struct device *dev);
606 const void *(*namespace)(struct device *dev);
608 void (*get_ownership)(struct device *dev, kuid_t *uid, kgid_t *gid);
637 int class_compat_create_link(struct class_compat *cls, struct device *dev,
639 void class_compat_remove_link(struct class_compat *cls, struct device *dev,
651 int (*fn)(struct device *dev, void *data));
812 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
813 char *(*devnode)(struct device *dev, umode_t *mode,
815 void (*release)(struct device *dev);
823 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
825 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
834 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
836 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
838 ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
840 ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
842 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
844 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
873 extern void device_remove_file(struct device *dev,
875 extern bool device_remove_file_self(struct device *dev,
877 extern int __must_check device_create_bin_file(struct device *dev,
879 extern void device_remove_bin_file(struct device *dev,
883 typedef void (*dr_release_t)(struct device *dev, void *res);
884 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
902 extern void devres_for_each_res(struct device *dev, dr_release_t release,
907 extern void devres_add(struct device *dev, void *res);
908 extern void *devres_find(struct device *dev, dr_release_t release,
910 extern void *devres_get(struct device *dev, void *new_res,
912 extern void *devres_remove(struct device *dev, dr_release_t release,
914 extern int devres_destroy(struct device *dev, dr_release_t release,
916 extern int devres_release(struct device *dev, dr_release_t release,
920 extern void * __must_check devres_open_group(struct device *dev, void *id,
922 extern void devres_close_group(struct device *dev, void *id);
923 extern void devres_remove_group(struct device *dev, void *id);
924 extern int devres_release_group(struct device *dev, void *id);
927 extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) __malloc;
929 char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
932 char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...) __malloc;
933 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) in devm_kzalloc() argument
935 return devm_kmalloc(dev, size, gfp | __GFP_ZERO); in devm_kzalloc()
937 static inline void *devm_kmalloc_array(struct device *dev, in devm_kmalloc_array() argument
945 return devm_kmalloc(dev, bytes, flags); in devm_kmalloc_array()
947 static inline void *devm_kcalloc(struct device *dev, in devm_kcalloc() argument
950 return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); in devm_kcalloc()
952 extern void devm_kfree(struct device *dev, const void *p);
953 extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
954 extern const char *devm_kstrdup_const(struct device *dev,
956 extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
959 extern unsigned long devm_get_free_pages(struct device *dev,
961 extern void devm_free_pages(struct device *dev, unsigned long addr);
963 void __iomem *devm_ioremap_resource(struct device *dev,
966 void __iomem *devm_of_iomap(struct device *dev,
971 int devm_add_action(struct device *dev, void (*action)(void *), void *data);
972 void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
973 void devm_release_action(struct device *dev, void (*action)(void *), void *data);
975 static inline int devm_add_action_or_reset(struct device *dev, in devm_add_action_or_reset() argument
980 ret = devm_add_action(dev, action, data); in devm_add_action_or_reset()
998 #define devm_alloc_percpu(dev, type) \ argument
999 ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \
1002 void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
1004 void devm_free_percpu(struct device *dev, void __percpu *pdata);
1039 void *device_connection_find_match(struct device *dev, const char *con_id,
1042 struct device *device_connection_find(struct device *dev, const char *con_id);
1334 void (*release)(struct device *dev);
1360 static inline bool device_iommu_mapped(struct device *dev) in device_iommu_mapped() argument
1362 return (dev->iommu_group != NULL); in device_iommu_mapped()
1368 static inline const char *dev_name(const struct device *dev) in dev_name() argument
1371 if (dev->init_name) in dev_name()
1372 return dev->init_name; in dev_name()
1374 return kobject_name(&dev->kobj); in dev_name()
1378 int dev_set_name(struct device *dev, const char *name, ...);
1381 static inline int dev_to_node(struct device *dev) in dev_to_node() argument
1383 return dev->numa_node; in dev_to_node()
1385 static inline void set_dev_node(struct device *dev, int node) in set_dev_node() argument
1387 dev->numa_node = node; in set_dev_node()
1390 static inline int dev_to_node(struct device *dev) in dev_to_node() argument
1394 static inline void set_dev_node(struct device *dev, int node) in set_dev_node() argument
1399 static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) in dev_get_msi_domain() argument
1402 return dev->msi_domain; in dev_get_msi_domain()
1408 static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d) in dev_set_msi_domain() argument
1411 dev->msi_domain = d; in dev_set_msi_domain()
1415 static inline void *dev_get_drvdata(const struct device *dev) in dev_get_drvdata() argument
1417 return dev->driver_data; in dev_get_drvdata()
1420 static inline void dev_set_drvdata(struct device *dev, void *data) in dev_set_drvdata() argument
1422 dev->driver_data = data; in dev_set_drvdata()
1425 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) in dev_to_psd() argument
1427 return dev ? dev->power.subsys_data : NULL; in dev_to_psd()
1430 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) in dev_get_uevent_suppress() argument
1432 return dev->kobj.uevent_suppress; in dev_get_uevent_suppress()
1435 static inline void dev_set_uevent_suppress(struct device *dev, int val) in dev_set_uevent_suppress() argument
1437 dev->kobj.uevent_suppress = val; in dev_set_uevent_suppress()
1440 static inline int device_is_registered(struct device *dev) in device_is_registered() argument
1442 return dev->kobj.state_in_sysfs; in device_is_registered()
1445 static inline void device_enable_async_suspend(struct device *dev) in device_enable_async_suspend() argument
1447 if (!dev->power.is_prepared) in device_enable_async_suspend()
1448 dev->power.async_suspend = true; in device_enable_async_suspend()
1451 static inline void device_disable_async_suspend(struct device *dev) in device_disable_async_suspend() argument
1453 if (!dev->power.is_prepared) in device_disable_async_suspend()
1454 dev->power.async_suspend = false; in device_disable_async_suspend()
1457 static inline bool device_async_suspend_enabled(struct device *dev) in device_async_suspend_enabled() argument
1459 return !!dev->power.async_suspend; in device_async_suspend_enabled()
1462 static inline bool device_pm_not_required(struct device *dev) in device_pm_not_required() argument
1464 return dev->power.no_pm; in device_pm_not_required()
1467 static inline void device_set_pm_not_required(struct device *dev) in device_set_pm_not_required() argument
1469 dev->power.no_pm = true; in device_set_pm_not_required()
1472 static inline void dev_pm_syscore_device(struct device *dev, bool val) in dev_pm_syscore_device() argument
1475 dev->power.syscore = val; in dev_pm_syscore_device()
1479 static inline void dev_pm_set_driver_flags(struct device *dev, u32 flags) in dev_pm_set_driver_flags() argument
1481 dev->power.driver_flags = flags; in dev_pm_set_driver_flags()
1484 static inline bool dev_pm_test_driver_flags(struct device *dev, u32 flags) in dev_pm_test_driver_flags() argument
1486 return !!(dev->power.driver_flags & flags); in dev_pm_test_driver_flags()
1489 static inline void device_lock(struct device *dev) in device_lock() argument
1491 mutex_lock(&dev->mutex); in device_lock()
1494 static inline int device_lock_interruptible(struct device *dev) in device_lock_interruptible() argument
1496 return mutex_lock_interruptible(&dev->mutex); in device_lock_interruptible()
1499 static inline int device_trylock(struct device *dev) in device_trylock() argument
1501 return mutex_trylock(&dev->mutex); in device_trylock()
1504 static inline void device_unlock(struct device *dev) in device_unlock() argument
1506 mutex_unlock(&dev->mutex); in device_unlock()
1509 static inline void device_lock_assert(struct device *dev) in device_lock_assert() argument
1511 lockdep_assert_held(&dev->mutex); in device_lock_assert()
1514 static inline struct device_node *dev_of_node(struct device *dev) in dev_of_node() argument
1516 if (!IS_ENABLED(CONFIG_OF) || !dev) in dev_of_node()
1518 return dev->of_node; in dev_of_node()
1521 static inline bool dev_has_sync_state(struct device *dev) in dev_has_sync_state() argument
1523 if (!dev) in dev_has_sync_state()
1525 if (dev->driver && dev->driver->sync_state) in dev_has_sync_state()
1527 if (dev->bus && dev->bus->sync_state) in dev_has_sync_state()
1537 extern int __must_check device_register(struct device *dev);
1538 extern void device_unregister(struct device *dev);
1539 extern void device_initialize(struct device *dev);
1540 extern int __must_check device_add(struct device *dev);
1541 extern void device_del(struct device *dev);
1542 extern int device_for_each_child(struct device *dev, void *data,
1543 int (*fn)(struct device *dev, void *data));
1544 extern int device_for_each_child_reverse(struct device *dev, void *data,
1545 int (*fn)(struct device *dev, void *data));
1546 extern struct device *device_find_child(struct device *dev, void *data,
1547 int (*match)(struct device *dev, void *data));
1550 extern int device_rename(struct device *dev, const char *new_name);
1551 extern int device_move(struct device *dev, struct device *new_parent,
1553 extern const char *device_get_devnode(struct device *dev,
1557 static inline bool device_supports_offline(struct device *dev) in device_supports_offline() argument
1559 return dev->bus && dev->bus->offline && dev->bus->online; in device_supports_offline()
1565 extern int device_offline(struct device *dev);
1566 extern int device_online(struct device *dev);
1567 extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1568 extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1569 void device_set_of_node_from_dev(struct device *dev, const struct device *dev2);
1571 static inline int dev_num_vf(struct device *dev) in dev_num_vf() argument
1573 if (dev->bus && dev->bus->num_vf) in dev_num_vf()
1574 return dev->bus->num_vf(dev); in dev_num_vf()
1590 static inline void *dev_get_platdata(const struct device *dev) in dev_get_platdata() argument
1592 return dev->platform_data; in dev_get_platdata()
1599 extern int __must_check device_bind_driver(struct device *dev);
1600 extern void device_release_driver(struct device *dev);
1601 extern int __must_check device_attach(struct device *dev);
1603 extern void device_initial_probe(struct device *dev);
1604 extern int __must_check device_reprobe(struct device *dev);
1606 extern bool device_is_bound(struct device *dev);
1626 extern int __must_check device_add_groups(struct device *dev,
1628 extern void device_remove_groups(struct device *dev,
1631 static inline int __must_check device_add_group(struct device *dev, in device_add_group() argument
1636 return device_add_groups(dev, groups); in device_add_group()
1639 static inline void device_remove_group(struct device *dev, in device_remove_group() argument
1644 return device_remove_groups(dev, groups); in device_remove_group()
1647 extern int __must_check devm_device_add_groups(struct device *dev,
1649 extern void devm_device_remove_groups(struct device *dev,
1651 extern int __must_check devm_device_add_group(struct device *dev,
1653 extern void devm_device_remove_group(struct device *dev,
1662 extern int (*platform_notify)(struct device *dev);
1664 extern int (*platform_notify_remove)(struct device *dev);
1671 extern struct device *get_device(struct device *dev);
1672 extern void put_device(struct device *dev);
1673 extern bool kill_device(struct device *dev);
1676 extern int devtmpfs_create_node(struct device *dev);
1677 extern int devtmpfs_delete_node(struct device *dev);
1680 static inline int devtmpfs_create_node(struct device *dev) { return 0; } in devtmpfs_create_node() argument
1681 static inline int devtmpfs_delete_node(struct device *dev) { return 0; } in devtmpfs_delete_node() argument
1689 extern const char *dev_driver_string(const struct device *dev);
1706 int dev_vprintk_emit(int level, const struct device *dev,
1709 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
1712 void dev_printk(const char *level, const struct device *dev,
1715 void _dev_emerg(const struct device *dev, const char *fmt, ...);
1717 void _dev_alert(const struct device *dev, const char *fmt, ...);
1719 void _dev_crit(const struct device *dev, const char *fmt, ...);
1721 void _dev_err(const struct device *dev, const char *fmt, ...);
1723 void _dev_warn(const struct device *dev, const char *fmt, ...);
1725 void _dev_notice(const struct device *dev, const char *fmt, ...);
1727 void _dev_info(const struct device *dev, const char *fmt, ...);
1732 int dev_vprintk_emit(int level, const struct device *dev, in dev_vprintk_emit() argument
1736 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) in dev_printk_emit() argument
1739 static inline void __dev_printk(const char *level, const struct device *dev, in __dev_printk() argument
1743 void dev_printk(const char *level, const struct device *dev, in dev_printk() argument
1748 void _dev_emerg(const struct device *dev, const char *fmt, ...) in _dev_emerg() argument
1751 void _dev_crit(const struct device *dev, const char *fmt, ...) in _dev_crit() argument
1754 void _dev_alert(const struct device *dev, const char *fmt, ...) in _dev_alert() argument
1757 void _dev_err(const struct device *dev, const char *fmt, ...) in _dev_err() argument
1760 void _dev_warn(const struct device *dev, const char *fmt, ...) in _dev_warn() argument
1763 void _dev_notice(const struct device *dev, const char *fmt, ...) in _dev_notice() argument
1766 void _dev_info(const struct device *dev, const char *fmt, ...) in _dev_info() argument
1776 #define dev_emerg(dev, fmt, ...) \ argument
1777 _dev_emerg(dev, dev_fmt(fmt), ##__VA_ARGS__)
1778 #define dev_crit(dev, fmt, ...) \ argument
1779 _dev_crit(dev, dev_fmt(fmt), ##__VA_ARGS__)
1780 #define dev_alert(dev, fmt, ...) \ argument
1781 _dev_alert(dev, dev_fmt(fmt), ##__VA_ARGS__)
1782 #define dev_err(dev, fmt, ...) \ argument
1783 _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
1784 #define dev_warn(dev, fmt, ...) \ argument
1785 _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
1786 #define dev_notice(dev, fmt, ...) \ argument
1787 _dev_notice(dev, dev_fmt(fmt), ##__VA_ARGS__)
1788 #define dev_info(dev, fmt, ...) \ argument
1789 _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
1792 #define dev_dbg(dev, fmt, ...) \ argument
1793 dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
1795 #define dev_dbg(dev, fmt, ...) \ argument
1796 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)
1798 #define dev_dbg(dev, fmt, ...) \ argument
1801 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
1806 #define dev_level_once(dev_level, dev, fmt, ...) \ argument
1812 dev_level(dev, fmt, ##__VA_ARGS__); \
1816 #define dev_level_once(dev_level, dev, fmt, ...) \ argument
1819 dev_level(dev, fmt, ##__VA_ARGS__); \
1823 #define dev_emerg_once(dev, fmt, ...) \ argument
1824 dev_level_once(dev_emerg, dev, fmt, ##__VA_ARGS__)
1825 #define dev_alert_once(dev, fmt, ...) \ argument
1826 dev_level_once(dev_alert, dev, fmt, ##__VA_ARGS__)
1827 #define dev_crit_once(dev, fmt, ...) \ argument
1828 dev_level_once(dev_crit, dev, fmt, ##__VA_ARGS__)
1829 #define dev_err_once(dev, fmt, ...) \ argument
1830 dev_level_once(dev_err, dev, fmt, ##__VA_ARGS__)
1831 #define dev_warn_once(dev, fmt, ...) \ argument
1832 dev_level_once(dev_warn, dev, fmt, ##__VA_ARGS__)
1833 #define dev_notice_once(dev, fmt, ...) \ argument
1834 dev_level_once(dev_notice, dev, fmt, ##__VA_ARGS__)
1835 #define dev_info_once(dev, fmt, ...) \ argument
1836 dev_level_once(dev_info, dev, fmt, ##__VA_ARGS__)
1837 #define dev_dbg_once(dev, fmt, ...) \ argument
1838 dev_level_once(dev_dbg, dev, fmt, ##__VA_ARGS__)
1840 #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ argument
1846 dev_level(dev, fmt, ##__VA_ARGS__); \
1849 #define dev_emerg_ratelimited(dev, fmt, ...) \ argument
1850 dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
1851 #define dev_alert_ratelimited(dev, fmt, ...) \ argument
1852 dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
1853 #define dev_crit_ratelimited(dev, fmt, ...) \ argument
1854 dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__)
1855 #define dev_err_ratelimited(dev, fmt, ...) \ argument
1856 dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__)
1857 #define dev_warn_ratelimited(dev, fmt, ...) \ argument
1858 dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)
1859 #define dev_notice_ratelimited(dev, fmt, ...) \ argument
1860 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
1861 #define dev_info_ratelimited(dev, fmt, ...) \ argument
1862 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
1865 #define dev_dbg_ratelimited(dev, fmt, ...) \ argument
1873 __dynamic_dev_dbg(&descriptor, dev, dev_fmt(fmt), \
1877 #define dev_dbg_ratelimited(dev, fmt, ...) \ argument
1883 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
1886 #define dev_dbg_ratelimited(dev, fmt, ...) \ argument
1889 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
1896 #define dev_vdbg(dev, fmt, ...) \ argument
1899 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
1907 #define dev_WARN(dev, format, arg...) \ argument
1908 WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg);
1910 #define dev_WARN_ONCE(dev, condition, format, arg...) \ argument
1912 dev_driver_string(dev), dev_name(dev), ## arg)