char: xillybus: Remove usage of 'pci_unmap_single()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 27 Aug 2021 17:17:39 +0000 (19:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 09:12:56 +0000 (11:12 +0200)
commit0b1eff5152b3646c9e33b7e0e5dd6f0f2006b06c
tree8459975619113ba9529f4350c14f4f262af73355
parentb46f7d3309fdd1695df7576a5329077d6b94d2ad
char: xillybus: Remove usage of 'pci_unmap_single()'

'struct xilly_mapping' includes a 'void *device' field which holds,
depending of the context, a 'struct device *' or a 'struct pci_dev *'.

This field is then used with 'pci_umap_single()' in 'xillybus_pcie.c' and
with 'dma_umap_single()' in 'xillybus_of.c'.

In order to remove usage of the deprecated 'pci_unmap_single()' API, turn
the 'void *device' field from 'struct xilly_mapping', into an explicit
'struct device *device' and use 'dma_umap_single()' everywhere.

In order to update 'xillybus_pcie.c', use the 'dev' field instead of the
'pdev' field from the 'struct xilly_endpoint'.
Both fields are initialized by 'xillybus_init_endpoint()' and in
'xillybus_pcie.c', we have:
xillybus_init_endpoint(pdev, &pdev->dev, &pci_hw);
                                 ^       ^
        xilly_endpoint.pdev = ___|       |___ = xilly_endpoint.dev
So the modification from pci_ to dma_ function is straightforward.

While at it, remove a comment that is wrong, because in the case above,
both 'dev' and 'pdev' are not NULL.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/baa3f6c7f009d9c231ae320bf1d568268bfef089.1630083668.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xillybus/xillybus.h
drivers/char/xillybus/xillybus_pcie.c