On 16 July 2012 09:45, Girish K S <girish.shivananjappa@xxxxxxxxxx> wrote: > On 12 July 2012 18:24, Thomas Abraham <thomas.abraham@xxxxxxxxxx> wrote: [...] >> >> +#ifdef CONFIG_OF >> +static struct dw_mci_drv_data synopsis_drv_data = { >> + .ctrl_type = DW_MCI_TYPE_SYNOPSIS, >> +}; >> + >> +static const struct of_device_id dw_mci_pltfm_match[] = { >> + { .compatible = "snps,dw-mshc", >> + .data = (void *)&synopsis_drv_data, }, >> + {}, >> +}; >> +MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match); >> +#else >> +static const struct of_device_id dw_mci_pltfm_match[]; > the #else and a statement can be completely removed if of_match_ptr is > used while accessing the dw_mci_pltfm_match in of_match_node function. >> +#endif >> + >> static int dw_mci_pltfm_probe(struct platform_device *pdev) >> { >> struct dw_mci *host; >> @@ -51,6 +67,13 @@ static int dw_mci_pltfm_probe(struct platform_device *pdev) >> if (!host->regs) >> goto err_free; >> platform_set_drvdata(pdev, host); >> + >> + if (pdev->dev.of_node) { >> + const struct of_device_id *match; >> + match = of_match_node(dw_mci_pltfm_match, pdev->dev.of_node); > can be modified to of_match_node(of_match_pt(dw_mci_pltfm_match), > pdev->dev.of_node); > This will remove the dummy allocation of variable as mentioned above. > Also it will be generic in non dt case. Ok. Thanks for the suggestion. I will modify it as per your suggestion. Thanks, Thomas. [...] -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html