Skip to content

Commit

Permalink
of: move of_address_to_resource and of_iomap declarations from sparc
Browse files Browse the repository at this point in the history
Move of_address_to_resource and of_iomap declarations to common code. These
only differ on sparc, but the declarations are the same and don't need to
be in arch header.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
  • Loading branch information
Rob Herring committed Oct 10, 2013
1 parent 32df8dc commit 4acf4b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
8 changes: 0 additions & 8 deletions arch/sparc/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,5 @@ extern char *of_console_options;
extern void irq_trans_init(struct device_node *dp);
extern char *build_path_component(struct device_node *dp);

/* SPARC has local implementations */
extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r);
#define of_address_to_resource of_address_to_resource

void __iomem *of_iomap(struct device_node *node, int index);
#define of_iomap of_iomap

#endif /* __KERNEL__ */
#endif /* _SPARC_PROM_H */
30 changes: 17 additions & 13 deletions include/linux/of_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,14 @@ extern struct of_pci_range *of_pci_range_parser_one(
struct of_pci_range_parser *parser,
struct of_pci_range *range);
#else /* CONFIG_OF_ADDRESS */
#ifndef of_address_to_resource
static inline int of_address_to_resource(struct device_node *dev, int index,
struct resource *r)
{
return -EINVAL;
}
#endif
static inline struct device_node *of_find_matching_node_by_address(
struct device_node *from,
const struct of_device_id *matches,
u64 base_address)
{
return NULL;
}
#ifndef of_iomap
static inline void __iomem *of_iomap(struct device_node *device, int index)
{
return NULL;
}
#endif

static inline const __be32 *of_get_address(struct device_node *dev, int index,
u64 *size, unsigned int *flags)
{
Expand All @@ -100,6 +88,22 @@ static inline struct of_pci_range *of_pci_range_parser_one(
}
#endif /* CONFIG_OF_ADDRESS */

#ifdef CONFIG_OF
extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r);
void __iomem *of_iomap(struct device_node *node, int index);
#else
static inline int of_address_to_resource(struct device_node *dev, int index,
struct resource *r)
{
return -EINVAL;
}

static inline void __iomem *of_iomap(struct device_node *device, int index)
{
return NULL;
}
#endif

#if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)
extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
Expand Down

0 comments on commit 4acf4b9

Please sign in to comment.