Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for building on Kernel 6.0.12 #25

Merged
merged 3 commits into from Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions driver/ntv2_device.c
Expand Up @@ -685,9 +685,9 @@ static int ntv2_device_dma_configure(struct ntv2_device *ntv2_dev)
pci_set_master(pdev);

/* set dma mask to 64 bits with fallback to 32 bits*/
result = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
result = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
if (result == 0) {
result = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
result = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
if (result < 0) {
NTV2_MSG_DEVICE_ERROR("%s: set consistent dma mask to 64 bit failed code %d\n",
ntv2_dev->name, result);
Expand All @@ -696,13 +696,13 @@ static int ntv2_device_dma_configure(struct ntv2_device *ntv2_dev)
NTV2_MSG_DEVICE_INFO("%s: pci dma mask = 64 bit\n", ntv2_dev->name);
}
else {
result = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
result = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (result < 0) {
NTV2_MSG_DEVICE_ERROR("%s: set dma mask to 32 bit failed code %d\n",
ntv2_dev->name, result);
return result;
}
result = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
result = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
if (result < 0) {
NTV2_MSG_DEVICE_ERROR("%s: set consistent dma mask to 32 bit failed code %d\n",
ntv2_dev->name, result);
Expand Down
9 changes: 5 additions & 4 deletions driver/ntv2_nwldma.c
Expand Up @@ -105,7 +105,7 @@ void ntv2_nwldma_close(struct ntv2_nwldma *ntv2_nwl)

/* free the descriptor memory */
if (ntv2_nwl->descriptor != NULL) {
pci_free_consistent(ntv2_nwl->ntv2_dev->pci_dev,
dma_free_coherent(&(ntv2_nwl->ntv2_dev->pci_dev)->dev,
ntv2_nwl->descriptor_memsize,
ntv2_nwl->descriptor,
ntv2_nwl->dma_descriptor);
Expand Down Expand Up @@ -160,9 +160,10 @@ int ntv2_nwldma_configure(struct ntv2_nwldma *ntv2_nwl, struct ntv2_register *nw

/* allocate descriptor memory */
ntv2_nwl->descriptor_memsize = ntv2_nwl->max_descriptors * sizeof(struct ntv2_nwldma_descriptor);
ntv2_nwl->descriptor = pci_alloc_consistent(ntv2_nwl->ntv2_dev->pci_dev,
ntv2_nwl->descriptor_memsize,
&ntv2_nwl->dma_descriptor);
ntv2_nwl->descriptor = dma_alloc_coherent(&(ntv2_nwl->ntv2_dev->pci_dev)->dev,
ntv2_nwl->descriptor_memsize,
&ntv2_nwl->dma_descriptor,
GFP_ATOMIC);
if (ntv2_nwl->descriptor == NULL) {
NTV2_MSG_DMA_ERROR("%s: *error* descriptor memory allocation failed\n", ntv2_nwl->name);
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion driver/ntv2_serial.c
Expand Up @@ -168,7 +168,7 @@ static void ntv2_uartops_shutdown(struct uart_port *port)

static void ntv2_uartops_set_termios(struct uart_port *port,
struct ktermios *termios,
struct ktermios *old)
const struct ktermios *old)
{
struct ntv2_serial *ntv2_ser = container_of(port, struct ntv2_serial, uart_port);
u32 valid = NTV2_FLD_MASK(ntv2_kona_fld_serial_rx_valid);
Expand Down
7 changes: 4 additions & 3 deletions driver/ntv2_xlxdma.c
Expand Up @@ -108,7 +108,7 @@ void ntv2_xlxdma_close(struct ntv2_xlxdma *ntv2_xlx)

/* free the descriptor memory */
if (ntv2_xlx->descriptor != NULL) {
pci_free_consistent(ntv2_xlx->ntv2_dev->pci_dev,
dma_free_coherent(&(ntv2_xlx->ntv2_dev->pci_dev)->dev,
ntv2_xlx->descriptor_memsize,
ntv2_xlx->descriptor,
ntv2_xlx->dma_descriptor);
Expand Down Expand Up @@ -192,9 +192,10 @@ int ntv2_xlxdma_configure(struct ntv2_xlxdma *ntv2_xlx, struct ntv2_register *xl

/* allocate descriptor memory */
ntv2_xlx->descriptor_memsize = ntv2_xlx->max_descriptors * sizeof(struct ntv2_xlxdma_descriptor);
ntv2_xlx->descriptor = pci_alloc_consistent(ntv2_xlx->ntv2_dev->pci_dev,
ntv2_xlx->descriptor = dma_alloc_coherent(&(ntv2_xlx->ntv2_dev->pci_dev)->dev,
ntv2_xlx->descriptor_memsize,
&ntv2_xlx->dma_descriptor);
&ntv2_xlx->dma_descriptor,
GFP_ATOMIC);
if (ntv2_xlx->descriptor == NULL) {
NTV2_MSG_DMA_ERROR("%s: *error* descriptor memory allocation failed\n", ntv2_xlx->name);
return -ENOMEM;
Expand Down