Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519389 > unrolled thread

question about hva_hw_probe

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2016-11-10 23:00 +0100
Last post2016-11-10 23:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  question about hva_hw_probe Julia Lawall <julia.lawall@lip6.fr> - 2016-11-10 23:00 +0100

#1519389 — question about hva_hw_probe

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-11-10 23:00 +0100
Subjectquestion about hva_hw_probe
Message-ID<sC5y2-3AU-7@gated-at.bofh.it>
The function hva_hw_probe in the file
drivers/media/platform/sti/hva/hva-hw.c contains the following code:

        /* get memory for esram */
        esram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
        if (IS_ERR_OR_NULL(esram)) {
                dev_err(dev, "%s     failed to get esram\n", HVA_PREFIX);
                return PTR_ERR(esram);
        }
        hva->esram_addr = esram->start;
        hva->esram_size = resource_size(esram);

platform_get_resource only returns NULL on failure, so the test of
IS_ERR_OR_NULL doesn't look appropriate.  Nor does the return value of
PTR_ERR(esram), which will be 0 on a NULL result.  But I wondered if it
was intended to have a call to devm_ioremap_resource between the
platform_get_resource and the IS_ERR_OR_NULL test (which should be just
IS_ERR; likewise for the call just above)?

thanks,
julia

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web