On Wed, Dec 03, 2014 at 11:29:26PM +0800, Andy Yan wrote:
+int imx_hdmi_bind(struct device *dev, struct device *master,
void *data, struct drm_encoder *encoder,
const struct imx_hdmi_plat_data *plat_data)
{ struct platform_device *pdev = to_platform_device(dev);
- const struct of_device_id *of_id =
struct drm_device *drm = data; struct device_node *np = dev->of_node; struct device_node *ddc_node;of_match_device(imx_hdmi_dt_ids, dev);
@@ -1594,19 +1566,16 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data) struct resource *iores; int ret, irq;
- hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
- hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); if (!hdmi) return -ENOMEM;
- hdmi->dev = dev;
- hdmi->plat_data = plat_data;
- hdmi->dev = &pdev->dev;
- hdmi->dev_type = plat_data->dev_type; hdmi->sample_rate = 48000; hdmi->ratio = 100;
- if (of_id) {
const struct platform_device_id *device_id = of_id->data;
hdmi->dev_type = device_id->driver_data;
- }
- hdmi->encoder = encoder;
I'd suggest changing imx_hdmi_bind() to take the struct resource and irq number, and avoiding the platform device stuff altogether in here.