Skip to content

Commit 3654f01

Browse files
Christoph Hellwighdeller
authored andcommitted
parisc: remove the HBA_DATA macro
No need to hide a cast in a macro, especially as all users have cleaner ways to archive the result than blind casting. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 5007526 commit 3654f01

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

arch/parisc/include/asm/pci.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ struct pci_hba_data {
6666
char gmmio_name[HBA_NAME_SIZE];
6767
};
6868

69-
#define HBA_DATA(d) ((struct pci_hba_data *) (d))
70-
7169
/*
7270
** We support 2^16 I/O ports per HBA. These are set up in the form
7371
** 0xbbxxxx, where bb is the bus number and xxxx is the I/O port

drivers/parisc/ccio-dma.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,7 @@ static int __init ccio_probe(struct parisc_device *dev)
15191519
{
15201520
int i;
15211521
struct ioc *ioc, **ioc_p = &ioc_list;
1522+
struct pci_hba_data *hba;
15221523

15231524
ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
15241525
if (ioc == NULL) {
@@ -1545,11 +1546,13 @@ static int __init ccio_probe(struct parisc_device *dev)
15451546
ccio_ioc_init(ioc);
15461547
ccio_init_resources(ioc);
15471548
hppa_dma_ops = &ccio_ops;
1548-
dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
15491549

1550+
hba = kzalloc(sizeof(*hba), GFP_KERNEL);
15501551
/* if this fails, no I/O cards will work, so may as well bug */
1551-
BUG_ON(dev->dev.platform_data == NULL);
1552-
HBA_DATA(dev->dev.platform_data)->iommu = ioc;
1552+
BUG_ON(hba == NULL);
1553+
1554+
hba->iommu = ioc;
1555+
dev->dev.platform_data = hba;
15531556

15541557
#ifdef CONFIG_PROC_FS
15551558
if (ioc_count == 0) {

drivers/parisc/lba_pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
12751275
r->flags = IORESOURCE_MEM;
12761276
/* mmio_mask also clears Enable bit */
12771277
r->start &= mmio_mask;
1278-
r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start);
1278+
r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start);
12791279
rsize = ~ READ_REG32(lba_dev->hba.base_addr + LBA_LMMIO_MASK);
12801280

12811281
/*
@@ -1321,7 +1321,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
13211321
r->flags = IORESOURCE_MEM;
13221322
/* mmio_mask also clears Enable bit */
13231323
r->start &= mmio_mask;
1324-
r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start);
1324+
r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start);
13251325
rsize = READ_REG32(lba_dev->hba.base_addr + LBA_ELMMIO_MASK);
13261326
r->end = r->start + ~rsize;
13271327
}
@@ -1562,7 +1562,7 @@ lba_driver_probe(struct parisc_device *dev)
15621562

15631563
/* ------------ Second : initialize common stuff ---------- */
15641564
pci_bios = &lba_bios_ops;
1565-
pcibios_register_hba(HBA_DATA(lba_dev));
1565+
pcibios_register_hba(&lba_dev->hba);
15661566
spin_lock_init(&lba_dev->lba_lock);
15671567

15681568
if (lba_hw_init(lba_dev))

0 commit comments

Comments
 (0)