Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bab58350 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'dt-fixes-for-3.7' of git://sources.calxeda.com/kernel/linux

Pull DeviceTree fixes from Rob Herring:
 "A handful of fixes:
   - a fix for dtc from upstream
   - sparse fixes in DeviceTree code
   - stub of_get_child_by_name for !OF builds"

* tag 'dt-fixes-for-3.7' of git://sources.calxeda.com/kernel/linux:
  dtc: fix for_each_*() to skip first object if deleted
  of/platform: sparse fix
  of/irq: sparse fixes
  of/address: sparse fixes
  of: add stub of_get_child_by_name for non-OF builds
parents ec351832 205a8eb7
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -37,9 +37,9 @@ struct of_bus {
	int		(*match)(struct device_node *parent);
	void		(*count_cells)(struct device_node *child,
				       int *addrc, int *sizec);
	u64		(*map)(u32 *addr, const __be32 *range,
	u64		(*map)(__be32 *addr, const __be32 *range,
				int na, int ns, int pna);
	int		(*translate)(u32 *addr, u64 offset, int na);
	int		(*translate)(__be32 *addr, u64 offset, int na);
	unsigned int	(*get_flags)(const __be32 *addr);
};

@@ -56,7 +56,7 @@ static void of_bus_default_count_cells(struct device_node *dev,
		*sizec = of_n_size_cells(dev);
}

static u64 of_bus_default_map(u32 *addr, const __be32 *range,
static u64 of_bus_default_map(__be32 *addr, const __be32 *range,
		int na, int ns, int pna)
{
	u64 cp, s, da;
@@ -82,7 +82,7 @@ static u64 of_bus_default_map(u32 *addr, const __be32 *range,
	return da - cp;
}

static int of_bus_default_translate(u32 *addr, u64 offset, int na)
static int of_bus_default_translate(__be32 *addr, u64 offset, int na)
{
	u64 a = of_read_number(addr, na);
	memset(addr, 0, na * 4);
@@ -138,7 +138,7 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr)
	return flags;
}

static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns,
static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
		int pna)
{
	u64 cp, s, da;
@@ -165,7 +165,7 @@ static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns,
	return da - cp;
}

static int of_bus_pci_translate(u32 *addr, u64 offset, int na)
static int of_bus_pci_translate(__be32 *addr, u64 offset, int na)
{
	return of_bus_default_translate(addr + 1, offset, na - 1);
}
@@ -247,7 +247,7 @@ static void of_bus_isa_count_cells(struct device_node *child,
		*sizec = 1;
}

static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns,
static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns,
		int pna)
{
	u64 cp, s, da;
@@ -270,7 +270,7 @@ static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns,
	return da - cp;
}

static int of_bus_isa_translate(u32 *addr, u64 offset, int na)
static int of_bus_isa_translate(__be32 *addr, u64 offset, int na)
{
	return of_bus_default_translate(addr + 1, offset, na - 1);
}
@@ -338,7 +338,7 @@ static struct of_bus *of_match_bus(struct device_node *np)
}

static int of_translate_one(struct device_node *parent, struct of_bus *bus,
			    struct of_bus *pbus, u32 *addr,
			    struct of_bus *pbus, __be32 *addr,
			    int na, int ns, int pna, const char *rprop)
{
	const __be32 *ranges;
@@ -409,12 +409,12 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
 * that can be mapped to a cpu physical address). This is not really specified
 * that way, but this is traditionally the way IBM at least do things
 */
u64 __of_translate_address(struct device_node *dev, const __be32 *in_addr,
			   const char *rprop)
static u64 __of_translate_address(struct device_node *dev,
				  const __be32 *in_addr, const char *rprop)
{
	struct device_node *parent = NULL;
	struct of_bus *bus, *pbus;
	u32 addr[OF_MAX_ADDR_CELLS];
	__be32 addr[OF_MAX_ADDR_CELLS];
	int na, ns, pna, pns;
	u64 result = OF_BAD_ADDR;

+5 −3
Original line number Diff line number Diff line
@@ -192,11 +192,13 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
			/* Compare specifiers */
			match = 1;
			for (i = 0; i < addrsize && match; ++i) {
				u32 mask = imask ? imask[i] : 0xffffffffu;
				__be32 mask = imask ? imask[i]
						    : cpu_to_be32(0xffffffffu);
				match = ((addr[i] ^ imap[i]) & mask) == 0;
			}
			for (; i < (addrsize + intsize) && match; ++i) {
				u32 mask = imask ? imask[i] : 0xffffffffu;
				__be32 mask = imask ? imask[i]
						    : cpu_to_be32(0xffffffffu);
				match =
				   ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
			}
@@ -465,7 +467,7 @@ void __init of_irq_init(const struct of_device_id *matches)
			pr_debug("of_irq_init: init %s @ %p, parent %p\n",
				 match->compatible,
				 desc->dev, desc->interrupt_parent);
			irq_init_cb = match->data;
			irq_init_cb = (of_irq_init_cb_t)match->data;
			ret = irq_init_cb(desc->dev, desc->interrupt_parent);
			if (ret) {
				kfree(desc);
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ void of_device_make_bus_id(struct device *dev)
{
	static atomic_t bus_no_reg_magic;
	struct device_node *node = dev->of_node;
	const u32 *reg;
	const __be32 *reg;
	u64 addr;
	const __be32 *addrp;
	int magic;
+7 −0
Original line number Diff line number Diff line
@@ -331,6 +331,13 @@ static inline bool of_have_populated_dt(void)
#define for_each_child_of_node(parent, child) \
	while (0)

static inline struct device_node *of_get_child_by_name(
					const struct device_node *node,
					const char *name)
{
	return NULL;
}

static inline int of_get_child_count(const struct device_node *np)
{
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
 * the address space flags too. The PCI version uses a BAR number
 * instead of an absolute index
 */
extern const u32 *of_get_address(struct device_node *dev, int index,
extern const __be32 *of_get_address(struct device_node *dev, int index,
			   u64 *size, unsigned int *flags);

#ifndef pci_address_to_pio
@@ -44,7 +44,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
{
	return NULL;
}
static inline const u32 *of_get_address(struct device_node *dev, int index,
static inline const __be32 *of_get_address(struct device_node *dev, int index,
					u64 *size, unsigned int *flags)
{
	return NULL;
Loading