public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* Uninitialized rx_req/tx_req (was: Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case)
@ 2013-09-12 12:41 Geert Uytterhoeven
  2013-09-12 15:10 ` Balaji T K
  2013-09-12 15:11 ` Balaji T K
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2013-09-12 12:41 UTC (permalink / raw)
  To: Matt Porter
  Cc: Balaji T K, Chris Ball, Grant Likely, Rob Herring, Vinod Koul,
	Tony Lindgren, Devicetree Discuss, Linux OMAP List,
	Linux Kernel Mailing List, Linux MMC List, Arnd Bergmann,
	Dan Williams, Jon Hunter, Santosh Shilimkar

On Tue, Mar 5, 2013 at 10:13 PM, Matt Porter <mporter@ti.com> wrote:
> From: Santosh Shilimkar <santosh.shilimkar@ti.com>
>
> MMC driver probe will abort for DT case because of failed
> platform_get_resource_byname() lookup. Fix it by skipping resource
> byname lookup for device tree build.
>
> Issue is hidden because hwmod popullates the IO resources which
> helps to succeed platform_get_resource_byname() and probe.
>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index e79b12d..8ae1225 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>
>         omap_hsmmc_conf_bus_power(host);
>
> -       res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> -       if (!res) {
> -               dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> -               ret = -ENXIO;
> -               goto err_irq;
> -       }
> -       tx_req = res->start;
> +       if (!pdev->dev.of_node) {
> +               res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> +               if (!res) {
> +                       dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> +                       ret = -ENXIO;
> +                       goto err_irq;
> +               }
> +               tx_req = res->start;
>
> -       res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> -       if (!res) {
> -               dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> -               ret = -ENXIO;
> -               goto err_irq;
> +               res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> +               if (!res) {
> +                       dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> +                       ret = -ENXIO;
> +                       goto err_irq;
> +               }
> +               rx_req = res->start;
>         }
> -       rx_req = res->start;
>
>         dma_cap_zero(mask);
>         dma_cap_set(DMA_SLAVE, mask);

Now this is in mainline, I get (gcc 4.1.2):

drivers/mmc/host/omap_hsmmc.c: In function ‘omap_hsmmc_probe’:
drivers/mmc/host/omap_hsmmc.c:1779: warning: ‘rx_req’ may be used
uninitialized in this function
drivers/mmc/host/omap_hsmmc.c:1779: warning: ‘tx_req’ may be used
uninitialized in this function

Indeed, rx_req and tx_req are not initialized in the DT case.

Initializing them to zero is probably not the right fix. Where are the values
supposed to come from in the DT case?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-12 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 12:41 Uninitialized rx_req/tx_req (was: Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case) Geert Uytterhoeven
2013-09-12 15:10 ` Balaji T K
2013-09-12 15:11 ` Balaji T K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox