Skip to content

Commit e14d774

Browse files
gericksonpaulusmack
authored andcommitted
powerpc: Const-qualify Device Node Argument to DCR Resource Extent API
Add const qualifier to device_node argument for dcr_resource_{start,len} as of_get_property also const-qualifies this argument. Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 9dce3ce commit e14d774

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎arch/powerpc/include/asm/dcr.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ typedef dcr_host_mmio_t dcr_host_t;
6868
* additional helpers to read the DCR * base from the device-tree
6969
*/
7070
struct device_node;
71-
extern unsigned int dcr_resource_start(struct device_node *np,
71+
extern unsigned int dcr_resource_start(const struct device_node *np,
7272
unsigned int index);
73-
extern unsigned int dcr_resource_len(struct device_node *np,
73+
extern unsigned int dcr_resource_len(const struct device_node *np,
7474
unsigned int index);
7575
#endif /* CONFIG_PPC_DCR */
7676
#endif /* __ASSEMBLY__ */

‎arch/powerpc/sysdev/dcr.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ EXPORT_SYMBOL_GPL(dcr_write_generic);
124124

125125
#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
126126

127-
unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
127+
unsigned int dcr_resource_start(const struct device_node *np,
128+
unsigned int index)
128129
{
129130
unsigned int ds;
130131
const u32 *dr = of_get_property(np, "dcr-reg", &ds);
@@ -136,7 +137,7 @@ unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
136137
}
137138
EXPORT_SYMBOL_GPL(dcr_resource_start);
138139

139-
unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
140+
unsigned int dcr_resource_len(const struct device_node *np, unsigned int index)
140141
{
141142
unsigned int ds;
142143
const u32 *dr = of_get_property(np, "dcr-reg", &ds);

0 commit comments

Comments
 (0)