* [PATCH] mmc: omap_hsmmc: use platform_get_irq_optional for wake IRQ
@ 2026-07-26 21:57 Rosen Penev
2026-07-27 16:25 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-07-26 21:57 UTC (permalink / raw)
To: linux-mmc; +Cc: Ulf Hansson, open list:OMAP HS MMC SUPPORT, open list
Replace irq_of_parse_and_map() with platform_get_irq_optional() to
get the wake IRQ. This is a more portable approach that works with
both DT and non-DT platforms, and follows the modern platform API
conventions for optional IRQ resources.
The wake IRQ is now fetched earlier in the probe function alongside
the main IRQ, and the -EPROBE_DEFER case is handled properly before
the deferred probe can be triggered.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/mmc/host/omap_hsmmc.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 58c881f2725b..4b5589157c59 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1764,7 +1764,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
struct mmc_host *mmc;
struct omap_hsmmc_host *host = NULL;
struct resource *res;
- int ret, irq;
+ int ret, irq, wake_irq;
const struct of_device_id *match;
const struct omap_mmc_of_data *data;
void __iomem *base;
@@ -1792,6 +1792,11 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
+ wake_irq = platform_get_irq_optional(pdev, 1);
+ if (wake_irq == -EPROBE_DEFER)
+ return wake_irq;
+ wake_irq = max(wake_irq, 0);
+
base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(base))
return PTR_ERR(base);
@@ -1811,6 +1816,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
host->use_dma = 1;
host->dma_ch = -1;
host->irq = irq;
+ host->wake_irq = wake_irq;
host->mapbase = res->start + pdata->reg_offset;
host->base = base + pdata->reg_offset;
host->power_mode = MMC_POWER_OFF;
@@ -1820,9 +1826,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, host);
- if (pdev->dev.of_node)
- host->wake_irq = irq_of_parse_and_map(pdev->dev.of_node, 1);
-
mmc->ops = &omap_hsmmc_ops;
mmc->f_min = OMAP_MMC_MIN_CLOCK;
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: use platform_get_irq_optional for wake IRQ
2026-07-26 21:57 [PATCH] mmc: omap_hsmmc: use platform_get_irq_optional for wake IRQ Rosen Penev
@ 2026-07-27 16:25 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2026-07-27 16:25 UTC (permalink / raw)
To: Rosen Penev
Cc: linux-mmc, Ulf Hansson, open list:OMAP HS MMC SUPPORT, open list
On Sun, Jul 26, 2026 at 11:57 PM Rosen Penev <rosenp@gmail.com> wrote:
>
> Replace irq_of_parse_and_map() with platform_get_irq_optional() to
> get the wake IRQ. This is a more portable approach that works with
> both DT and non-DT platforms, and follows the modern platform API
> conventions for optional IRQ resources.
>
> The wake IRQ is now fetched earlier in the probe function alongside
> the main IRQ, and the -EPROBE_DEFER case is handled properly before
> the deferred probe can be triggered.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/omap_hsmmc.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 58c881f2725b..4b5589157c59 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1764,7 +1764,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
> struct mmc_host *mmc;
> struct omap_hsmmc_host *host = NULL;
> struct resource *res;
> - int ret, irq;
> + int ret, irq, wake_irq;
> const struct of_device_id *match;
> const struct omap_mmc_of_data *data;
> void __iomem *base;
> @@ -1792,6 +1792,11 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
> if (irq < 0)
> return irq;
>
> + wake_irq = platform_get_irq_optional(pdev, 1);
> + if (wake_irq == -EPROBE_DEFER)
> + return wake_irq;
> + wake_irq = max(wake_irq, 0);
> +
> base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> if (IS_ERR(base))
> return PTR_ERR(base);
> @@ -1811,6 +1816,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
> host->use_dma = 1;
> host->dma_ch = -1;
> host->irq = irq;
> + host->wake_irq = wake_irq;
> host->mapbase = res->start + pdata->reg_offset;
> host->base = base + pdata->reg_offset;
> host->power_mode = MMC_POWER_OFF;
> @@ -1820,9 +1826,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, host);
>
> - if (pdev->dev.of_node)
> - host->wake_irq = irq_of_parse_and_map(pdev->dev.of_node, 1);
> -
> mmc->ops = &omap_hsmmc_ops;
>
> mmc->f_min = OMAP_MMC_MIN_CLOCK;
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-27 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-26 21:57 [PATCH] mmc: omap_hsmmc: use platform_get_irq_optional for wake IRQ Rosen Penev
2026-07-27 16:25 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox