media: tw5864: Simplify 'tw5864_finidev()'

Some resources are allocated with 'pci_request_regions()', so use
'pci_release_regions()' to free them, instead of a verbose
'release_mem_region()'.

There is no point in calling 'devm_kfree()'. The corresponding resource is
managed, so it will be fried automatically.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Christophe JAILLET 2021-10-16 09:40:29 +01:00 коммит произвёл Mauro Carvalho Chehab
Родитель 20c82fffd6
Коммит 901181b7ff
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -333,11 +333,9 @@ static void tw5864_finidev(struct pci_dev *pci_dev)
/* release resources */
iounmap(dev->mmio);
release_mem_region(pci_resource_start(pci_dev, 0),
pci_resource_len(pci_dev, 0));
pci_release_regions(pci_dev);
v4l2_device_unregister(&dev->v4l2_dev);
devm_kfree(&pci_dev->dev, dev);
}
static struct pci_driver tw5864_pci_driver = {