mmc/host/sdhci-of-esdhc: Hold a reference returned by of_find_compatible_node
PATCH 1/1 mmc/host/sdhci-of-esdhc: Hold a reference returned by of_find_compatible_node
In sdhci_esdhc_probe(), we should hold the reference returned by of_find_compatible_node() which is used to of_node_put() for keep refcount balance.
Signed-off-by Liang He <[email protected]>
--- drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +4 -2
@@ -1418,7 +1418,7 @@ static int esdhc_hs400_prepare_ddr(struct mmc_host *mmc)static int sdhci_esdhc_probe (struct platform_device *pdev) {struct sdhci_host *host; -struct device_node *np; +struct device_node *np, *tp;struct sdhci_pltfm_host *pltfm_host;struct sdhci_esdhc *esdhc;int ret;
@@ -1463,7 +1463,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)if (esdhc->vendor_ver >VENDOR_V_22 ) host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ ; -if (of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" )) { + tp =of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" ); +if (tp) { +of_node_put (tp); host->quirks |=SDHCI_QUIRK_RESET_AFTER_REQUEST ; host->quirks |=SDHCI_QUIRK_BROKEN_TIMEOUT_VAL ; }
Signature · 1 line
2.25.1
Quoted 5 lines · Liang He
In
sdhci_esdhc_probe(), we should hold the reference returned byof_find_compatible_node()which is used toof_node_put()for keep refcount balance.Signed-off-by Liang He <[email protected]>
Acked-by Adrian Hunter <[email protected]>
Quoted 28 lines
--- drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-esdhc.c +4
-2@@ -1418,7 +1418,7 @@ static int esdhc_hs400_prepare_ddr(struct mmc_host *mmc)static int sdhci_esdhc_probe (struct platform_device *pdev) {struct sdhci_host *host; -struct device_node *np; +struct device_node *np, *tp;struct sdhci_pltfm_host *pltfm_host;struct sdhci_esdhc *esdhc;int ret;@@ -1463,7 +1463,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)if (esdhc->vendor_ver >VENDOR_V_22 ) host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ ; -if (of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" )) { + tp =of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" ); +if (tp) { +of_node_put (tp); host->quirks |=SDHCI_QUIRK_RESET_AFTER_REQUEST ; host->quirks |=SDHCI_QUIRK_BROKEN_TIMEOUT_VAL ; }
Quoted 6 lines · Liang He
In
sdhci_esdhc_probe(), we should hold the reference returned byof_find_compatible_node()which is used toof_node_put()for keep refcount balance.Signed-off-by Liang He <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 31 lines
--- drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-esdhc.c +4
-3@@ -1418,7 +1418,7 @@ static int esdhc_hs400_prepare_ddr(struct mmc_host *mmc)static int sdhci_esdhc_probe (struct platform_device *pdev) {struct sdhci_host *host; -struct device_node *np; +struct device_node *np, *tp;struct sdhci_pltfm_host *pltfm_host;struct sdhci_esdhc *esdhc;int ret;@@ -1463,7 +1463,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)if (esdhc->vendor_ver >VENDOR_V_22 ) host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ ; -if (of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" )) { + tp =of_find_compatible_node (NULL ,NULL ,"fsl,p2020-esdhc" ); +if (tp) { +of_node_put (tp); host->quirks |=SDHCI_QUIRK_RESET_AFTER_REQUEST ; host->quirks |=SDHCI_QUIRK_BROKEN_TIMEOUT_VAL ; } --2.25.1