aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-08 14:31:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-08 14:31:16 -0400
commit3f17ea6dea8ba5668873afa54628a91aaa3fb1c0 (patch)
treeafbeb2accd4c2199ddd705ae943995b143a0af02 /include/linux/device.h
parent1860e379875dfe7271c649058aeddffe5afd9d0d (diff)
parent1a5700bc2d10cd379a795fd2bb377a190af5acd4 (diff)
Merge branch 'next' (accumulated 3.16 merge window patches) into master
Now that 3.15 is released, this merges the 'next' branch into 'master', bringing us to the normal situation where my 'master' branch is the merge window. * accumulated work in next: (6809 commits) ufs: sb mutex merge + mutex_destroy powerpc: update comments for generic idle conversion cris: update comments for generic idle conversion idle: remove cpu_idle() forward declarations nbd: zero from and len fields in NBD_CMD_DISCONNECT. mm: convert some level-less printks to pr_* MAINTAINERS: adi-buildroot-devel is moderated MAINTAINERS: add linux-api for review of API/ABI changes mm/kmemleak-test.c: use pr_fmt for logging fs/dlm/debug_fs.c: replace seq_printf by seq_puts fs/dlm/lockspace.c: convert simple_str to kstr fs/dlm/config.c: convert simple_str to kstr mm: mark remap_file_pages() syscall as deprecated mm: memcontrol: remove unnecessary memcg argument from soft limit functions mm: memcontrol: clean up memcg zoneinfo lookup mm/memblock.c: call kmemleak directly from memblock_(alloc|free) mm/mempool.c: update the kmemleak stack trace for mempool allocations lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations mm: introduce kmemleak_update_trace() mm/kmemleak.c: use %u to print ->checksum ...
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index d1d1c055b48e..af424acd393d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -623,6 +623,12 @@ static inline void *devm_kcalloc(struct device *dev,
623} 623}
624extern void devm_kfree(struct device *dev, void *p); 624extern void devm_kfree(struct device *dev, void *p);
625extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); 625extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
626extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
627 gfp_t gfp);
628
629extern unsigned long devm_get_free_pages(struct device *dev,
630 gfp_t gfp_mask, unsigned int order);
631extern void devm_free_pages(struct device *dev, unsigned long addr);
626 632
627void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); 633void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
628void __iomem *devm_request_and_ioremap(struct device *dev, 634void __iomem *devm_request_and_ioremap(struct device *dev,
@@ -673,6 +679,7 @@ struct acpi_dev_node {
673 * variants, which GPIO pins act in what additional roles, and so 679 * variants, which GPIO pins act in what additional roles, and so
674 * on. This shrinks the "Board Support Packages" (BSPs) and 680 * on. This shrinks the "Board Support Packages" (BSPs) and
675 * minimizes board-specific #ifdefs in drivers. 681 * minimizes board-specific #ifdefs in drivers.
682 * @driver_data: Private pointer for driver specific info.
676 * @power: For device power management. 683 * @power: For device power management.
677 * See Documentation/power/devices.txt for details. 684 * See Documentation/power/devices.txt for details.
678 * @pm_domain: Provide callbacks that are executed during system suspend, 685 * @pm_domain: Provide callbacks that are executed during system suspend,
@@ -685,6 +692,7 @@ struct acpi_dev_node {
685 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all 692 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all
686 * hardware supports 64-bit addresses for consistent allocations 693 * hardware supports 64-bit addresses for consistent allocations
687 * such descriptors. 694 * such descriptors.
695 * @dma_pfn_offset: offset of DMA memory range relatively of RAM
688 * @dma_parms: A low level driver may set these to teach IOMMU code about 696 * @dma_parms: A low level driver may set these to teach IOMMU code about
689 * segment limitations. 697 * segment limitations.
690 * @dma_pools: Dma pools (if dma'ble device). 698 * @dma_pools: Dma pools (if dma'ble device).
@@ -734,6 +742,8 @@ struct device {
734 device */ 742 device */
735 void *platform_data; /* Platform specific data, device 743 void *platform_data; /* Platform specific data, device
736 core doesn't touch it */ 744 core doesn't touch it */
745 void *driver_data; /* Driver data, set and get with
746 dev_set/get_drvdata */
737 struct dev_pm_info power; 747 struct dev_pm_info power;
738 struct dev_pm_domain *pm_domain; 748 struct dev_pm_domain *pm_domain;
739 749
@@ -750,6 +760,7 @@ struct device {
750 not all hardware supports 760 not all hardware supports
751 64 bit addresses for consistent 761 64 bit addresses for consistent
752 allocations such descriptors. */ 762 allocations such descriptors. */
763 unsigned long dma_pfn_offset;
753 764
754 struct device_dma_parameters *dma_parms; 765 struct device_dma_parameters *dma_parms;
755 766
@@ -823,6 +834,16 @@ static inline void set_dev_node(struct device *dev, int node)
823} 834}
824#endif 835#endif
825 836
837static inline void *dev_get_drvdata(const struct device *dev)
838{
839 return dev->driver_data;
840}
841
842static inline void dev_set_drvdata(struct device *dev, void *data)
843{
844 dev->driver_data = data;
845}
846
826static inline struct pm_subsys_data *dev_to_psd(struct device *dev) 847static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
827{ 848{
828 return dev ? dev->power.subsys_data : NULL; 849 return dev ? dev->power.subsys_data : NULL;
@@ -907,8 +928,6 @@ extern int device_move(struct device *dev, struct device *new_parent,
907extern const char *device_get_devnode(struct device *dev, 928extern const char *device_get_devnode(struct device *dev,
908 umode_t *mode, kuid_t *uid, kgid_t *gid, 929 umode_t *mode, kuid_t *uid, kgid_t *gid,
909 const char **tmp); 930 const char **tmp);
910extern void *dev_get_drvdata(const struct device *dev);
911extern int dev_set_drvdata(struct device *dev, void *data);
912 931
913static inline bool device_supports_offline(struct device *dev) 932static inline bool device_supports_offline(struct device *dev)
914{ 933{