]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mmc: Use of_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Thu, 9 Jan 2025 15:52:54 +0000 (09:52 -0600)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Jan 2025 15:32:56 +0000 (16:32 +0100)
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/all/20250109155255.3438450-1-robh@kernel.org/
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/sdhci-esdhc-imx.c

index e7a286c3216fdbfcf278ef143d85216892566639..0a9affd12532071c48957bbb3b1b8d2ce91222c0 100644 (file)
@@ -995,7 +995,7 @@ static int mxcmci_probe(struct platform_device *pdev)
        struct mxcmci_host *host;
        struct resource *res;
        int ret = 0, irq;
-       bool dat3_card_detect = false;
+       bool dat3_card_detect;
        dma_cap_mask_t mask;
        struct imxmmc_platform_data *pdata = pdev->dev.platform_data;
 
@@ -1048,9 +1048,9 @@ static int mxcmci_probe(struct platform_device *pdev)
 
        if (pdata)
                dat3_card_detect = pdata->dat3_card_detect;
-       else if (mmc_card_is_removable(mmc)
-                       && !of_property_read_bool(pdev->dev.of_node, "cd-gpios"))
-               dat3_card_detect = true;
+       else
+               dat3_card_detect = mmc_card_is_removable(mmc) &&
+                                  !of_property_present(pdev->dev.of_node, "cd-gpios");
 
        ret = mmc_regulator_get_supply(mmc);
        if (ret)
index e23177ea9d9166de2c25f5f818f85efec2740b19..ff78a7c6a04c945dd2b01c5c6d408ba81a2a61f1 100644 (file)
@@ -1648,7 +1648,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
         * Retrieving and requesting the actual WP GPIO will happen
         * in the call to mmc_of_parse().
         */
-       if (of_property_read_bool(np, "wp-gpios"))
+       if (of_property_present(np, "wp-gpios"))
                boarddata->wp_type = ESDHC_WP_GPIO;
 
        of_property_read_u32(np, "fsl,tuning-step", &boarddata->tuning_step);