aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/wm8350-core.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 9a1a0b2b581e..cd1f76efed4e 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -1130,6 +1130,32 @@ out:
1130} 1130}
1131EXPORT_SYMBOL_GPL(wm8350_create_cache); 1131EXPORT_SYMBOL_GPL(wm8350_create_cache);
1132 1132
1133/*
1134 * Register a client device. This is non-fatal since there is no need to
1135 * fail the entire device init due to a single platform device failing.
1136 */
1137static void wm8350_client_dev_register(struct wm8350 *wm8350,
1138 const char *name,
1139 struct platform_device **pdev)
1140{
1141 int ret;
1142
1143 *pdev = platform_device_alloc(name, -1);
1144 if (pdev == NULL) {
1145 dev_err(wm8350->dev, "Failed to allocate %s\n", name);
1146 return;
1147 }
1148
1149 (*pdev)->dev.parent = wm8350->dev;
1150 platform_set_drvdata(*pdev, wm8350);
1151 ret = platform_device_add(*pdev);
1152 if (ret != 0) {
1153 dev_err(wm8350->dev, "Failed to register %s: %d\n", name, ret);
1154 platform_device_put(*pdev);
1155 *pdev = NULL;
1156 }
1157}
1158
1133int wm8350_device_init(struct wm8350 *wm8350, int irq, 1159int wm8350_device_init(struct wm8350 *wm8350, int irq,
1134 struct wm8350_platform_data *pdata) 1160 struct wm8350_platform_data *pdata)
1135{ 1161{