From a2710e79243f81b0a203eb04a311c8db07b919cb Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:11:07 +0000 Subject: fix-hdq-child-attach-callback.patch Along the same lines as FIQ, HDQ can have children in device tree terms too. Allow the same kind of callback in machine-specific code Signed-off-by: Andy Green --- drivers/power/gta02_hdq.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'drivers/power') diff --git a/drivers/power/gta02_hdq.c b/drivers/power/gta02_hdq.c index 89fd3fa8b4f..ac52ea8be4c 100644 --- a/drivers/power/gta02_hdq.c +++ b/drivers/power/gta02_hdq.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -205,8 +206,9 @@ static int __init gta02hdq_probe(struct platform_device *pdev) { struct resource *r = platform_get_resource(pdev, 0, 0); int ret; - - if (!machine_is_neo1973_gta02()) + struct gta02_hdq_platform_data *pdata = pdev->dev.platform_data; + + if (!machine_is_neo1973_gta02()) return -EIO; if (!r) @@ -233,6 +235,14 @@ static int __init gta02hdq_probe(struct platform_device *pdev) fiq_ipc.hdq_probed = 1; /* we are ready to do stuff now */ + /* + * if wanted, users can defer registration of devices + * that depend on HDQ until after we register, and can use our + * device as parent so suspend-resume ordering is correct + */ + if (pdata->attach_child_devices) + (pdata->attach_child_devices)(&pdev->dev); + return 0; } -- cgit v1.2.3