* [PATCH v2] mmc: Use of_property_present() for non-boolean properties
@ 2025-01-09 15:52 Rob Herring (Arm)
2025-01-13 15:37 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring (Arm) @ 2025-01-09 15:52 UTC (permalink / raw)
To: Ulf Hansson, Adrian Hunter, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Dragan Simic, linux-mmc, linux-kernel, imx, s32, linux-arm-kernel
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>
---
v2:
- Drop initialization of dat3_card_detect
- Rebase on next-20250109
---
drivers/mmc/host/mxcmmc.c | 8 ++++----
drivers/mmc/host/sdhci-esdhc-imx.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index e7a286c3216f..0a9affd12532 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -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)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index e23177ea9d91..ff78a7c6a04c 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -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);
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] mmc: Use of_property_present() for non-boolean properties
2025-01-09 15:52 [PATCH v2] mmc: Use of_property_present() for non-boolean properties Rob Herring (Arm)
@ 2025-01-13 15:37 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2025-01-13 15:37 UTC (permalink / raw)
To: Rob Herring (Arm)
Cc: Adrian Hunter, Haibo Chen, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Dragan Simic, linux-mmc,
linux-kernel, imx, s32, linux-arm-kernel
On Thu, 9 Jan 2025 at 16:53, Rob Herring (Arm) <robh@kernel.org> wrote:
>
> 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>
Applied for next, thanks!
Kind regards
Uffe
> ---
> v2:
> - Drop initialization of dat3_card_detect
> - Rebase on next-20250109
> ---
> drivers/mmc/host/mxcmmc.c | 8 ++++----
> drivers/mmc/host/sdhci-esdhc-imx.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index e7a286c3216f..0a9affd12532 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
> @@ -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)
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index e23177ea9d91..ff78a7c6a04c 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -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);
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-13 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 15:52 [PATCH v2] mmc: Use of_property_present() for non-boolean properties Rob Herring (Arm)
2025-01-13 15:37 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).