msm: mdm: change the way callbacks are passed to common code.
The common code now keeps a reference to a static struct containing
pointers to the callback functions instead of the individual function
pointers themselves. This is more in keeping with the normal way ops
are passed in the kernel.
Change-Id: I64fce3214d22071421be46cdd82654bbc6bccc1d
Signed-off-by: Joel King <joelking@codeaurora.org>
diff --git a/arch/arm/mach-msm/mdm_private.h b/arch/arm/mach-msm/mdm_private.h
index bc8541e..bd346bb 100644
--- a/arch/arm/mach-msm/mdm_private.h
+++ b/arch/arm/mach-msm/mdm_private.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -15,6 +15,14 @@
struct mdm_modem_drv;
+struct mdm_ops {
+ void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv);
+ void (*normal_boot_done_cb)(struct mdm_modem_drv *mdm_drv);
+ void (*power_down_mdm_cb)(struct mdm_modem_drv *mdm_drv);
+ void (*debug_state_changed_cb)(int value);
+ void (*status_cb)(int value);
+};
+
/* Private mdm2 data structure */
struct mdm_modem_drv {
unsigned mdm2ap_errfatal_gpio;
@@ -34,23 +42,11 @@
enum charm_boot_type boot_type;
int mdm_debug_on;
- void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv);
- void (*normal_boot_done_cb)(struct mdm_modem_drv *mdm_drv);
- void (*power_down_mdm_cb)(struct mdm_modem_drv *mdm_drv);
- void (*debug_state_changed_cb)(int value);
- void (*status_cb)(int value);
-};
-
-struct mdm_callbacks {
- void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv);
- void (*normal_boot_done_cb)(struct mdm_modem_drv *mdm_drv);
- void (*power_down_mdm_cb)(struct mdm_modem_drv *mdm_drv);
- void (*debug_state_changed_cb)(int value);
- void (*status_cb)(int value);
+ struct mdm_ops *ops;
};
int mdm_common_create(struct platform_device *pdev,
- struct mdm_callbacks *mdm_cb);
+ struct mdm_ops *mdm_cb);
int mdm_common_modem_remove(struct platform_device *pdev);
void mdm_common_modem_shutdown(struct platform_device *pdev);
void mdm_common_set_debug_state(int value);