esoc: Fix bugs in esoc_client registration

Fix incorrect esoc name descriptor from subsys_esocn
to esocn.
Add stub definition for registration and unregister
in case CONFIG_ESOC_CLIENT is not set.
Force probe deferral if requested external soc
has not yet probed.

Change-Id: I10a19c9f5eb0a1483b8ebf930e67f94a70c76151
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
This commit is contained in:
Hanumant Singh 2014-02-27 20:26:56 -08:00
parent de9a07414c
commit 41418b0df3
3 changed files with 23 additions and 3 deletions

View File

@ -861,6 +861,7 @@ static int mdm9x25_setup_hw(struct mdm_ctrl *mdm,
esoc->clink_ops = ops;
esoc->parent = mdm->dev;
esoc->owner = THIS_MODULE;
esoc->np = pdev->dev.of_node;
set_esoc_clink_data(esoc, mdm);
ret = esoc_clink_register(esoc);
if (ret) {
@ -933,6 +934,7 @@ static int mdm9x35_setup_hw(struct mdm_ctrl *mdm,
esoc->clink_ops = ops;
esoc->parent = mdm->dev;
esoc->owner = THIS_MODULE;
esoc->np = pdev->dev.of_node;
set_esoc_clink_data(esoc, mdm);
ret = esoc_clink_register(esoc);
if (ret) {

View File

@ -66,15 +66,15 @@ struct esoc_desc *devm_register_esoc_client(struct device *dev,
kfree(esoc_prop);
esoc_node = of_find_node_by_phandle(be32_to_cpup(parp));
esoc_clink = get_esoc_clink_by_node(esoc_node);
if (!esoc_clink) {
if (IS_ERR_OR_NULL(esoc_clink)) {
dev_err(dev, "matching esoc clink not present\n");
return NULL;
return ERR_PTR(-EPROBE_DEFER);
}
desc = devres_alloc(devm_esoc_desc_release,
sizeof(*desc), GFP_KERNEL);
if (!desc)
return ERR_PTR(-ENOMEM);
esoc_name = kasprintf(GFP_KERNEL, "subsys_esoc%d",
esoc_name = kasprintf(GFP_KERNEL, "esoc%d",
esoc_clink->id);
desc->name = esoc_name;
desc->priv = esoc_clink;

View File

@ -25,9 +25,27 @@ struct esoc_desc {
void *priv;
};
#ifdef CONFIG_ESOC_CLIENT
/* Can return probe deferral */
struct esoc_desc *devm_register_esoc_client(struct device *dev,
const char *name);
void devm_unregister_esoc_client(struct device *dev,
struct esoc_desc *esoc_desc);
int esoc_register_client_notifier(struct notifier_block *nb);
#else
static inline struct esoc_desc *devm_register_esoc_client(struct device *dev,
const char *name)
{
return NULL;
}
static inline void devm_unregister_esoc_client(struct device *dev,
struct esoc_desc *esoc_desc)
{
return;
}
static inline int esoc_register_client_notifier(struct notifier_block *nb)
{
return -EIO;
}
#endif
#endif