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

Commit 62a11ae3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6

* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  of: change of_match_device to work with struct device
  of: Remove duplicate fields from of_platform_driver
  drivercore: Add of_match_table to the common device drivers
  arch/microblaze: Move dma_mask from of_device into pdev_archdata
  arch/powerpc: Move dma_mask from of_device into pdev_archdata
  of: eliminate of_device->node and dev_archdata->{of,prom}_node
  of: Always use 'struct device.of_node' to get device node pointer.
  i2c/of: Allow device node to be passed via i2c_board_info
  driver-core: Add device node pointer to struct device
  of: protect contents of of_platform.h and of_device.h
  of/flattree: Make unflatten_device_tree() safe to call from any arch
  of/flattree: make of_fdt.h safe to unconditionally include.
parents cedfb2db cf9b59e9
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -12,29 +12,15 @@
struct device_node;

struct dev_archdata {
	/* Optional pointer to an OF device node */
	struct device_node	*of_node;

	/* DMA operations on that device */
	struct dma_map_ops	*dma_ops;
	void                    *dma_data;
};

struct pdev_archdata {
	u64 dma_mask;
};

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_MICROBLAZE_DEVICE_H */

+1 −2
Original line number Diff line number Diff line
@@ -21,9 +21,8 @@
 * probed using OF properties.
 */
struct of_device {
	struct device_node	*node; /* to be obsoleted */
	u64			dma_mask; /* DMA mask */
	struct device		dev; /* Generic device interface */
	struct pdev_archdata	archdata;
};

extern ssize_t of_device_get_modalias(struct of_device *ofdev,
+6 −7
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
void of_device_make_bus_id(struct of_device *dev)
{
	static atomic_t bus_no_reg_magic;
	struct device_node *node = dev->node;
	struct device_node *node = dev->dev.of_node;
	const u32 *reg;
	u64 addr;
	int magic;
@@ -49,11 +49,10 @@ struct of_device *of_device_alloc(struct device_node *np,
	if (!dev)
		return NULL;

	dev->node = of_node_get(np);
	dev->dev.dma_mask = &dev->dma_mask;
	dev->dev.of_node = of_node_get(np);
	dev->dev.dma_mask = &dev->archdata.dma_mask;
	dev->dev.parent = parent;
	dev->dev.release = of_release_dev;
	dev->dev.archdata.of_node = np;

	if (bus_id)
		dev_set_name(&dev->dev, bus_id);
@@ -75,17 +74,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)

	ofdev = to_of_device(dev);

	if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name))
	if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name))
		return -ENOMEM;

	if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type))
	if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type))
		return -ENOMEM;

	/* Since the compatible field can contain pretty much anything
	 * it's not really legal to split it out with commas. We split it
	 * up using a number of environment variables instead. */

	compat = of_get_property(ofdev->node, "compatible", &cplen);
	compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen);
	while (compat && *compat && cplen > 0) {
		if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
			return -ENOMEM;
+3 −3
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ struct of_device *of_platform_device_create(struct device_node *np,
	if (!dev)
		return NULL;

	dev->dma_mask = 0xffffffffUL;
	dev->archdata.dma_mask = 0xffffffffUL;
	dev->dev.bus = &of_platform_bus_type;

	/* We do not fill the DMA ops for platform devices by default.
@@ -166,7 +166,7 @@ EXPORT_SYMBOL(of_platform_bus_probe);

static int of_dev_node_match(struct device *dev, void *data)
{
	return to_of_device(dev)->node == data;
	return to_of_device(dev)->dev.of_node == data;
}

struct of_device *of_find_device_by_node(struct device_node *np)
@@ -184,7 +184,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
static int of_dev_phandle_match(struct device *dev, void *data)
{
	phandle *ph = data;
	return to_of_device(dev)->node->phandle == *ph;
	return to_of_device(dev)->dev.of_node->phandle == *ph;
}

struct of_device *of_find_device_by_phandle(phandle ph)
+1 −15
Original line number Diff line number Diff line
@@ -10,9 +10,6 @@ struct dma_map_ops;
struct device_node;

struct dev_archdata {
	/* Optional pointer to an OF device node */
	struct device_node	*of_node;

	/* DMA operations on that device */
	struct dma_map_ops	*dma_ops;

@@ -30,19 +27,8 @@ struct dev_archdata {
#endif
};

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;
}

struct pdev_archdata {
	u64 dma_mask;
};

#endif /* _ASM_POWERPC_DEVICE_H */
Loading