Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11347368 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman
Browse files

scsi: aic7xxx: fix EISA support



[ Upstream commit 144ec97493af34efdb77c5aba146e9c7de8d0a06 ]

Instead of relying on the now removed NULL argument to
pci_alloc_consistent, switch to the generic DMA API, and store the struct
device so that we can pass it.

Fixes: 4167b2ad ("PCI: Remove NULL device handling from PCI DMA API")
Reported-by: default avatarMatthew Whitehead <tedheadster@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarMatthew Whitehead <tedheadster@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ba87f547
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ aic7770_probe(struct device *dev)
	ahc = ahc_alloc(&aic7xxx_driver_template, name);
	if (ahc == NULL)
		return (ENOMEM);
	ahc->dev = dev;
	error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
			       eisaBase);
	if (error != 0) {
+1 −0
Original line number Diff line number Diff line
@@ -949,6 +949,7 @@ struct ahc_softc {
	 * Platform specific device information.
	 */
	ahc_dev_softc_t		  dev_softc;
	struct device		  *dev;

	/*
	 * Bus specific device information.
+4 −6
Original line number Diff line number Diff line
@@ -861,8 +861,8 @@ int
ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
		 int flags, bus_dmamap_t *mapp)
{
	*vaddr = pci_alloc_consistent(ahc->dev_softc,
				      dmat->maxsize, mapp);
	/* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */
	*vaddr = dma_alloc_coherent(ahc->dev, dmat->maxsize, mapp, GFP_ATOMIC);
	if (*vaddr == NULL)
		return ENOMEM;
	return 0;
@@ -872,8 +872,7 @@ void
ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat,
		void* vaddr, bus_dmamap_t map)
{
	pci_free_consistent(ahc->dev_softc, dmat->maxsize,
			    vaddr, map);
	dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map);
}

int
@@ -1124,8 +1123,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa

	host->transportt = ahc_linux_transport_template;

	retval = scsi_add_host(host,
			(ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
	retval = scsi_add_host(host, ahc->dev);
	if (retval) {
		printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n");
		scsi_host_put(host);
+1 −0
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
		}
	}
	ahc->dev_softc = pci;
	ahc->dev = &pci->dev;
	error = ahc_pci_config(ahc, entry);
	if (error != 0) {
		ahc_free(ahc);