Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138571
b: refs/heads/master
c: d746286
h: refs/heads/master
i:
  138569: 24ce68a
  138567: 9f8ba22
v: v3
  • Loading branch information
Kumar Gala authored and Benjamin Herrenschmidt committed Mar 24, 2009
1 parent 05626c4 commit cfdacd4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32ac57668dccf6c4ad5522b61a86fe211886c180
refs/heads/master: d746286c1fcb186ce16295c30d48db852ede6772
36 changes: 36 additions & 0 deletions trunk/arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <linux/debugfs.h>
#include <linux/percpu.h>
#include <linux/lmb.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/processor.h>
Expand Down Expand Up @@ -669,3 +671,37 @@ static int powerpc_debugfs_init(void)
}
arch_initcall(powerpc_debugfs_init);
#endif

static int ppc_dflt_bus_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
struct device *dev = data;

/* We are only intereted in device addition */
if (action != BUS_NOTIFY_ADD_DEVICE)
return 0;

set_dma_ops(dev, &dma_direct_ops);

return NOTIFY_DONE;
}

static struct notifier_block ppc_dflt_plat_bus_notifier = {
.notifier_call = ppc_dflt_bus_notify,
.priority = INT_MAX,
};

static struct notifier_block ppc_dflt_of_bus_notifier = {
.notifier_call = ppc_dflt_bus_notify,
.priority = INT_MAX,
};

static int __init setup_bus_notifier(void)
{
bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);

return 0;
}

arch_initcall(setup_bus_notifier);
13 changes: 0 additions & 13 deletions trunk/arch/powerpc/platforms/cell/qpace_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ static int __init qpace_publish_devices(void)
}
machine_subsys_initcall(qpace, qpace_publish_devices);

extern int qpace_notify(struct device *dev)
{
/* set dma_ops for of_platform bus */
if (dev->bus && dev->bus->name
&& !strcmp(dev->bus->name, "of_platform"))
set_dma_ops(dev, &dma_direct_ops);

return 0;
}

static void __init qpace_setup_arch(void)
{
#ifdef CONFIG_SPU_BASE
Expand All @@ -115,9 +105,6 @@ static void __init qpace_setup_arch(void)
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

/* set notifier function */
platform_notify = &qpace_notify;
}

static int __init qpace_probe(void)
Expand Down

0 comments on commit cfdacd4

Please sign in to comment.