Example #1
0
static struct modem_ctl *create_modemctl_device(struct platform_device *pdev)
{
	int ret = 0;
	struct modem_data *pdata;
	struct modem_ctl *modemctl;
	struct device *dev = &pdev->dev;

	/* create modem control device */
	modemctl = kzalloc(sizeof(struct modem_ctl), GFP_KERNEL);
	if (!modemctl)
		return NULL;

	modemctl->dev = dev;
	modemctl->phone_state = STATE_OFFLINE;

	pdata = pdev->dev.platform_data;
	modemctl->name = pdata->name;

	/* init modemctl device for getting modemctl operations */
	ret = call_modem_init_func(modemctl, pdata);
	if (ret) {
		kfree(modemctl);
		return NULL;
	}

	pr_debug("[MODEM_IF] %s:create_modemctl_device DONE\n", modemctl->name);
	return modemctl;
}
Example #2
0
static struct modem_ctl *create_modemctl_device(struct platform_device *pdev)
{
	int ret = 0;
	struct modem_data *pdata;
	struct modem_ctl *modemctl;
	struct device *dev = &pdev->dev;

	pr_debug("[MIF] <%s> Called!!\n", __func__);
	/* create modem control device */
	modemctl = kzalloc(sizeof(struct modem_ctl), GFP_KERNEL);
	if (!modemctl) {
		pr_err("[MIF] <%s> Allocation Failed!!\n", __func__);
		return NULL;
	}

	modemctl->dev = dev;
	modemctl->phone_state = STATE_OFFLINE;

	pdata = pdev->dev.platform_data;
	modemctl->name = pdata->name;

	/* init modemctl device for getting modemctl operations */
	ret = call_modem_init_func(modemctl, pdata);
	if (ret) {
		pr_err("[MIF] <%s> Modem init failed!!\n", __func__);
		kfree(modemctl);
		return NULL;
	}

	pr_debug("[MIF] <%s> Create_modemctl_device DONE [%s]\n",
		__func__, modemctl->name);
	return modemctl;
}