Skip to content

Commit d7aacad

Browse files
Magnus Dammrjwysocki
authored andcommitted
Driver Core: Add platform device arch data V3
Allow architecture specific data in struct platform_device V3. With this patch struct pdev_archdata is added to struct platform_device, similar to struct dev_archdata in found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device. Struct pdev_archdata is different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures. The structure pdev_archdata is a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like struct dev_archdata but for platform devices. [rjw: This change is for power management mostly and that's why it goes through the suspend tree.] Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
1 parent aea1f79 commit d7aacad

8 files changed

Lines changed: 24 additions & 0 deletions

File tree

arch/arm/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ struct dev_archdata {
1212
#endif
1313
};
1414

15+
struct pdev_archdata {
16+
};
17+
1518
#endif

arch/ia64/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ struct dev_archdata {
1515
#endif
1616
};
1717

18+
struct pdev_archdata {
19+
};
20+
1821
#endif /* _ASM_IA64_DEVICE_H */

arch/microblaze/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ struct dev_archdata {
1616
struct device_node *of_node;
1717
};
1818

19+
struct pdev_archdata {
20+
};
21+
1922
#endif /* _ASM_MICROBLAZE_DEVICE_H */
2023

2124

arch/powerpc/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
3030
return ad->of_node;
3131
}
3232

33+
struct pdev_archdata {
34+
};
35+
3336
#endif /* _ASM_POWERPC_DEVICE_H */

arch/sparc/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
3232
return ad->prom_node;
3333
}
3434

35+
struct pdev_archdata {
36+
};
37+
3538
#endif /* _ASM_SPARC_DEVICE_H */

arch/x86/include/asm/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops;
1313
#endif
1414
};
1515

16+
struct pdev_archdata {
17+
};
18+
1619
#endif /* _ASM_X86_DEVICE_H */

include/asm-generic/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
struct dev_archdata {
1010
};
1111

12+
struct pdev_archdata {
13+
};
14+
1215
#endif /* _ASM_GENERIC_DEVICE_H */

include/linux/platform_device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct platform_device {
2222
struct resource * resource;
2323

2424
struct platform_device_id *id_entry;
25+
26+
/* arch specific additions */
27+
struct pdev_archdata archdata;
2528
};
2629

2730
#define platform_get_device_id(pdev) ((pdev)->id_entry)

0 commit comments

Comments
 (0)