media: hantro: add fallback handling for single irq/clk
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 1 Apr 2021 14:43:33 +0000 (16:43 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 19 May 2021 07:51:40 +0000 (09:51 +0200)
commit18d6c8b7b4c94c5e2e5b5807d9484b4d54b8fa1b
treee99d0d0bcbccd3830ff18dcfff9502a25b37ef8c
parentbbc42ab0da985f538eefe1b470a610624e53829f
media: hantro: add fallback handling for single irq/clk

Currently the driver expects that each irq/clk will have a name
specified.

A valid point was raised by the DT maintainers - when there is a single
interrupt line or clock - the names are not needed.

Keep the names within the drivers themselves, but don't use them when
only a single entry exists. Instead use:
 - num_clk == 1 - devm_clk_get(..., NULL)
 - num_irq == 1 - platform_get_irq(..., 0)

Suggested-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/hantro/hantro_drv.c