modify mu509 driver to solve NULL pointer bug.
authorzwp <zwp@rock-chips.com>
Sat, 14 Jan 2012 05:19:13 +0000 (13:19 +0800)
committerzwp <zwp@rock-chips.com>
Sat, 14 Jan 2012 05:20:53 +0000 (13:20 +0800)
drivers/misc/mu509.c
include/linux/mu509.h

index 2171e50a4a30621121a0d8a6232df30b94340964..6a613c29e0d156937eee8e8674b62902eb7c94f8 100755 (executable)
@@ -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);
index 8db5ac2286c79be8cf65342c1d4ce58f8a6e7d7f..0c69ff84e0f7910e3daa0a890871951169e2d5d3 100644 (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;