mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* question about hva_hw_probe
@ 2016-11-10 21:51 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2016-11-10 21:51 UTC (permalink / raw)
  To: Jean-Christophe Trotin, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Christophe JAILLET

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-10 21:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 21:51 question about hva_hw_probe Julia Lawall

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

all inboxes | Powered by JetHome®