Skip to content

Commit 57a217f

Browse files
robherringstorulf
authored andcommitted
mmc: Use of_property_present() for non-boolean properties
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 <[email protected]> Reviewed-by: Dragan Simic <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Ulf Hansson <[email protected]>
1 parent 285035a commit 57a217f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/mmc/host/mxcmmc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static int mxcmci_probe(struct platform_device *pdev)
995995
struct mxcmci_host *host;
996996
struct resource *res;
997997
int ret = 0, irq;
998-
bool dat3_card_detect = false;
998+
bool dat3_card_detect;
999999
dma_cap_mask_t mask;
10001000
struct imxmmc_platform_data *pdata = pdev->dev.platform_data;
10011001

@@ -1048,9 +1048,9 @@ static int mxcmci_probe(struct platform_device *pdev)
10481048

10491049
if (pdata)
10501050
dat3_card_detect = pdata->dat3_card_detect;
1051-
else if (mmc_card_is_removable(mmc)
1052-
&& !of_property_read_bool(pdev->dev.of_node, "cd-gpios"))
1053-
dat3_card_detect = true;
1051+
else
1052+
dat3_card_detect = mmc_card_is_removable(mmc) &&
1053+
!of_property_present(pdev->dev.of_node, "cd-gpios");
10541054

10551055
ret = mmc_regulator_get_supply(mmc);
10561056
if (ret)

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
16481648
* Retrieving and requesting the actual WP GPIO will happen
16491649
* in the call to mmc_of_parse().
16501650
*/
1651-
if (of_property_read_bool(np, "wp-gpios"))
1651+
if (of_property_present(np, "wp-gpios"))
16521652
boarddata->wp_type = ESDHC_WP_GPIO;
16531653

16541654
of_property_read_u32(np, "fsl,tuning-step", &boarddata->tuning_step);

0 commit comments

Comments
 (0)