Skip to content

Commit

Permalink
powerpc and sparc: Introduce dev_archdata node accessors
Browse files Browse the repository at this point in the history
The name of the device_node field differ across the platforms, so we
have to implement inlined accessors.  This is needed to avoid ugly
#ifdef in the generic code.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Anton Vorontsov authored and Paul Mackerras committed Dec 3, 2008
1 parent a0e2f9f commit 3f3b163
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch/powerpc/include/asm/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,16 @@ struct dev_archdata {
void *dma_data;
};

static inline void dev_archdata_set_node(struct dev_archdata *ad,
struct device_node *np)
{
ad->of_node = np;
}

static inline struct device_node *
dev_archdata_get_node(const struct dev_archdata *ad)
{
return ad->of_node;
}

#endif /* _ASM_POWERPC_DEVICE_H */
12 changes: 12 additions & 0 deletions arch/sparc/include/asm/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ struct dev_archdata {
int numa_node;
};

static inline void dev_archdata_set_node(struct dev_archdata *ad,
struct device_node *np)
{
ad->prom_node = np;
}

static inline struct device_node *
dev_archdata_get_node(const struct dev_archdata *ad)
{
return ad->prom_node;
}

#endif /* _ASM_SPARC_DEVICE_H */

0 comments on commit 3f3b163

Please sign in to comment.