On 16 July 2012 09:45, Girish K S [off-list ref] wrote:
On 12 July 2012 18:24, Thomas Abraham [off-list ref] wrote:
[...]
quoted
+#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.
quoted
+#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.
[...]