plx_dma.c (cbecf716ca618fd44feda6bd9a64a8179d031fc5) plx_dma.c (07503e6aefe4a6efd777062191944a14f03b3a18)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Microsemi Switchtec(tm) PCIe Management Driver
4 * Copyright (c) 2019, Logan Gunthorpe <logang@deltatee.com>
5 * Copyright (c) 2019, GigaIO Networks, Inc
6 */
7
8#include "dmaengine.h"

--- 493 unchanged lines hidden (view full) ---

502 int rc;
503
504 plxdev = kzalloc(sizeof(*plxdev), GFP_KERNEL);
505 if (!plxdev)
506 return -ENOMEM;
507
508 rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0,
509 KBUILD_MODNAME, plxdev);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Microsemi Switchtec(tm) PCIe Management Driver
4 * Copyright (c) 2019, Logan Gunthorpe <logang@deltatee.com>
5 * Copyright (c) 2019, GigaIO Networks, Inc
6 */
7
8#include "dmaengine.h"

--- 493 unchanged lines hidden (view full) ---

502 int rc;
503
504 plxdev = kzalloc(sizeof(*plxdev), GFP_KERNEL);
505 if (!plxdev)
506 return -ENOMEM;
507
508 rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0,
509 KBUILD_MODNAME, plxdev);
510 if (rc) {
511 kfree(plxdev);
512 return rc;
513 }
510 if (rc)
511 goto free_plx;
514
515 spin_lock_init(&plxdev->ring_lock);
516 tasklet_setup(&plxdev->desc_task, plx_dma_desc_task);
517
518 RCU_INIT_POINTER(plxdev->pdev, pdev);
519 plxdev->bar = pcim_iomap_table(pdev)[0];
520
521 dma = &plxdev->dma_dev;

--- 13 unchanged lines hidden (view full) ---

535 chan = &plxdev->dma_chan;
536 chan->device = dma;
537 dma_cookie_init(chan);
538 list_add_tail(&chan->device_node, &dma->channels);
539
540 rc = dma_async_device_register(dma);
541 if (rc) {
542 pci_err(pdev, "Failed to register dma device: %d\n", rc);
512
513 spin_lock_init(&plxdev->ring_lock);
514 tasklet_setup(&plxdev->desc_task, plx_dma_desc_task);
515
516 RCU_INIT_POINTER(plxdev->pdev, pdev);
517 plxdev->bar = pcim_iomap_table(pdev)[0];
518
519 dma = &plxdev->dma_dev;

--- 13 unchanged lines hidden (view full) ---

533 chan = &plxdev->dma_chan;
534 chan->device = dma;
535 dma_cookie_init(chan);
536 list_add_tail(&chan->device_node, &dma->channels);
537
538 rc = dma_async_device_register(dma);
539 if (rc) {
540 pci_err(pdev, "Failed to register dma device: %d\n", rc);
543 free_irq(pci_irq_vector(pdev, 0), plxdev);
544 kfree(plxdev);
545 return rc;
541 goto put_device;
546 }
547
548 pci_set_drvdata(pdev, plxdev);
549
550 return 0;
542 }
543
544 pci_set_drvdata(pdev, plxdev);
545
546 return 0;
547
548put_device:
549 put_device(&pdev->dev);
550 free_irq(pci_irq_vector(pdev, 0), plxdev);
551free_plx:
552 kfree(plxdev);
553
554 return rc;
551}
552
553static int plx_dma_probe(struct pci_dev *pdev,
554 const struct pci_device_id *id)
555{
556 int rc;
557
558 rc = pcim_enable_device(pdev);

--- 80 unchanged lines hidden ---
555}
556
557static int plx_dma_probe(struct pci_dev *pdev,
558 const struct pci_device_id *id)
559{
560 int rc;
561
562 rc = pcim_enable_device(pdev);

--- 80 unchanged lines hidden ---