@@ -545,12 +545,13 @@ MODULE_DEVICE_TABLE(of, dw_mci_exynos_match);
static int dw_mci_exynos_probe(struct platform_device *pdev)
{
- const struct dw_mci_drv_data *drv_data;
+ const struct dw_mci_drv_data *drv_data = NULL;
const struct of_device_id *match;
int ret;
match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node);
- drv_data = match->data;
+ if (match)
+ drv_data = match->data;
pm_runtime_get_noresume(&pdev->dev);
pm_runtime_set_active(&pdev->dev);
@@ -451,11 +451,12 @@ MODULE_DEVICE_TABLE(of, dw_mci_k3_match);
static int dw_mci_k3_probe(struct platform_device *pdev)
{
- const struct dw_mci_drv_data *drv_data;
+ const struct dw_mci_drv_data *drv_data = NULL;
const struct of_device_id *match;
match = of_match_node(dw_mci_k3_match, pdev->dev.of_node);
- drv_data = match->data;
+ if (match)
+ drv_data = match->data;
return dw_mci_pltfm_register(pdev, drv_data);
}
@@ -78,7 +78,8 @@ static int dw_mci_pltfm_probe(struct platform_device *pdev)
if (pdev->dev.of_node) {
match = of_match_node(dw_mci_pltfm_match, pdev->dev.of_node);
- drv_data = match->data;
+ if (match)
+ drv_data = match->data;
}
return dw_mci_pltfm_register(pdev, drv_data);
@@ -1520,6 +1520,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
const struct sdhci_arasan_of_data *data;
match = of_match_node(sdhci_arasan_of_match, pdev->dev.of_node);
+ if (match == NULL)
+ return -ENOPARAM;
data = match->data;
host = sdhci_pltfm_init(pdev, data->pdata, sizeof(*sdhci_arasan));