static int jz4740_probe(struct platform_device *pdev)
 {
        struct device                   *dev = &pdev->dev;
-       const struct musb_hdrc_platform_data *pdata = &jz4740_musb_pdata;
+       const struct musb_hdrc_platform_data *pdata;
        struct platform_device          *musb;
        struct jz4740_glue              *glue;
        struct clk                      *clk;
        if (!glue)
                return -ENOMEM;
 
+       pdata = of_device_get_match_data(dev);
+       if (!pdata) {
+               dev_err(dev, "missing platform data");
+               return -EINVAL;
+       }
+
        musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
        if (!musb) {
                dev_err(dev, "failed to allocate musb device");
        return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id jz4740_musb_of_match[] = {
-       { .compatible = "ingenic,jz4740-musb" },
+       { .compatible = "ingenic,jz4740-musb", .data = &jz4740_musb_pdata },
        { /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, jz4740_musb_of_match);
-#endif
 
 static struct platform_driver jz4740_driver = {
        .probe          = jz4740_probe,
        .remove         = jz4740_remove,
        .driver         = {
                .name   = "musb-jz4740",
-               .of_match_table = of_match_ptr(jz4740_musb_of_match),
+               .of_match_table = jz4740_musb_of_match,
        },
 };