linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines
@ 2022-03-22 14:46 trix
  2022-03-30  4:01 ` Martin K. Petersen
  2022-04-07 13:35 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: trix @ 2022-03-22 14:46 UTC (permalink / raw)
  To: hare, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Tom Rix

From: Tom Rix <trix@redhat.com>

Common defines should be used over custom defines.

Change and remove these defines
PCIR_SUBVEND_0 to PCI_SUBSYSTEM_VENDOR_ID
PCIR_SUBDEV_0 to PCI_SUBSYSTEM_ID

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/scsi/aic7xxx/aic79xx_osm.h | 2 --
 drivers/scsi/aic7xxx/aic79xx_pci.c | 6 +++---
 drivers/scsi/aic7xxx/aic7xxx_osm.h | 2 --
 drivers/scsi/aic7xxx/aic7xxx_pci.c | 4 ++--
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 679a4fd138746..793fe19993a90 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -420,8 +420,6 @@ ahd_unlock(struct ahd_softc *ahd, unsigned long *flags)
 
 /* config registers for header type 0 devices */
 #define PCIR_MAPS	0x10
-#define PCIR_SUBVEND_0	0x2c
-#define PCIR_SUBDEV_0	0x2e
 
 /****************************** PCI-X definitions *****************************/
 #define PCIXR_COMMAND	0x96
diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c
index 2f0bdb9225a40..5fad41b1ab58d 100644
--- a/drivers/scsi/aic7xxx/aic79xx_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_pci.c
@@ -260,8 +260,8 @@ ahd_find_pci_device(ahd_dev_softc_t pci)
 
 	vendor = ahd_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2);
 	device = ahd_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
-	subvendor = ahd_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
-	subdevice = ahd_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);
+	subvendor = ahd_pci_read_config(pci, PCI_SUBSYSTEM_VENDOR_ID, /*bytes*/2);
+	subdevice = ahd_pci_read_config(pci, PCI_SUBSYSTEM_ID, /*bytes*/2);
 	full_id = ahd_compose_id(device,
 				 vendor,
 				 subdevice,
@@ -298,7 +298,7 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry)
 	 * Record if this is an HP board.
 	 */
 	subvendor = ahd_pci_read_config(ahd->dev_softc,
-					PCIR_SUBVEND_0, /*bytes*/2);
+					PCI_SUBSYSTEM_VENDOR_ID, /*bytes*/2);
 	if (subvendor == SUBID_HP)
 		ahd->flags |= AHD_HP_BOARD;
 
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 4782a304e93cc..51d9f4de07346 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -433,8 +433,6 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long *flags)
 
 /* config registers for header type 0 devices */
 #define PCIR_MAPS	0x10
-#define PCIR_SUBVEND_0	0x2c
-#define PCIR_SUBDEV_0	0x2e
 
 typedef enum
 {
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
index dab3a6d12c4d2..2d4c85426dc3e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
@@ -673,8 +673,8 @@ ahc_find_pci_device(ahc_dev_softc_t pci)
 
 	vendor = ahc_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2);
 	device = ahc_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
-	subvendor = ahc_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
-	subdevice = ahc_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);
+	subvendor = ahc_pci_read_config(pci, PCI_SUBSYSTEM_VENDOR_ID, /*bytes*/2);
+	subdevice = ahc_pci_read_config(pci, PCI_SUBSYSTEM_ID, /*bytes*/2);
 	full_id = ahc_compose_id(device, vendor, subdevice, subvendor);
 
 	/*
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines
  2022-03-22 14:46 [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines trix
@ 2022-03-30  4:01 ` Martin K. Petersen
  2022-04-07 13:35 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-03-30  4:01 UTC (permalink / raw)
  To: trix; +Cc: hare, jejb, martin.petersen, linux-scsi, linux-kernel


Tom,

> Change and remove these defines
> PCIR_SUBVEND_0 to PCI_SUBSYSTEM_VENDOR_ID
> PCIR_SUBDEV_0 to PCI_SUBSYSTEM_ID

Applied to 5.18/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines
  2022-03-22 14:46 [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines trix
  2022-03-30  4:01 ` Martin K. Petersen
@ 2022-04-07 13:35 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-04-07 13:35 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K . Petersen

On Tue, 22 Mar 2022 07:46:48 -0700, trix@redhat.com wrote:

> From: Tom Rix <trix@redhat.com>
> 
> Common defines should be used over custom defines.
> 
> Change and remove these defines
> PCIR_SUBVEND_0 to PCI_SUBSYSTEM_VENDOR_ID
> PCIR_SUBDEV_0 to PCI_SUBSYSTEM_ID
> 
> [...]

Applied to 5.18/scsi-fixes, thanks!

[1/1] aic7xxx: use standard pci subsystem, subdevice defines
      https://git.kernel.org/mkp/scsi/c/37a9bd7090cd

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-07 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 14:46 [PATCH] [SCSI] aic7xxx: use standard pci subsystem, subdevice defines trix
2022-03-30  4:01 ` Martin K. Petersen
2022-04-07 13:35 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).