modify mu509 driver to solve NULL pointer bug.

This commit is contained in:
zwp
2012-01-14 13:19:13 +08:00
parent e7a8ed88d3
commit 2a4680b714
2 changed files with 5 additions and 2 deletions

View File

@@ -100,8 +100,8 @@ static int mu509_open(struct inode *inode, struct file *file)
{
//MODEMDBG("-------------%s\n",__FUNCTION__);
struct rk29_mu509_data *pdata = gpdata;
struct platform_data *pdev = container_of(pdata, struct device, platform_data);
device_init_wakeup(&pdev, 1);
// struct platform_data *pdev = container_of(pdata, struct device, platform_data);
device_init_wakeup(pdata->dev, 1);
return 0;
}
@@ -191,6 +191,8 @@ static int mu509_probe(struct platform_device *pdev)
struct modem_dev *mu509_data = NULL;
int result, irq = 0;
//MODEMDBG("-------------%s\n",__FUNCTION__);
pdata->dev = &pdev->dev;
if(pdata->io_init)
pdata->io_init();
gpio_set_value(pdata->bp_reset, GPIO_HIGH);

View File

@@ -11,6 +11,7 @@ struct modem_dev
/* 耳机数据结构体 */
struct rk29_mu509_data {
struct device *dev;
int (*io_init)(void);
int (*io_deinit)(void);
unsigned int bp_power;