[PATCH 12/17] libata: use LLD name where possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When acquiring resources, use LLD name where possible.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>

---

 drivers/scsi/libata-bmdma.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

89c097fc1f9e41b7c2d7a03d0aa0857bed6b6b5d
diff --git a/drivers/scsi/libata-bmdma.c b/drivers/scsi/libata-bmdma.c
index 4cc316d..75eec7a 100644
--- a/drivers/scsi/libata-bmdma.c
+++ b/drivers/scsi/libata-bmdma.c
@@ -894,11 +894,12 @@ unsigned int ata_pci_legacy_mask(struct 
 	return mask;
 }
 
-static int ata_pci_acquire_legacy(int port, unsigned long *host_set_flags)
+static int ata_pci_acquire_legacy(int port, const char *name,
+				  unsigned long *host_set_flags)
 {
 	unsigned long cmd_addr = ata_legacy_addr_tbl[port][0];
 
-	if (request_region(cmd_addr, 8, "libata") != NULL)
+	if (request_region(cmd_addr, 8, name) != NULL)
 		*host_set_flags |= ATA_HOST_RES_LEGACY_PRI << port;
 	else {
 		struct resource *conflict, res;
@@ -980,6 +981,16 @@ int ata_pci_set_dma_mask(struct pci_dev 
 	return rc;
 }
 
+static const char *ata_drv_name(struct device *dev)
+{
+	const char *name = dev_driver_string(dev);
+
+	if (name[0] != '\0')
+		return name;
+
+	return DRV_NAME;
+}
+
 /**
  *	ata_pci_acquire_resources - acquire default PCI resources
  *	@host_set: target ATA host_set to acquire PCI resources for
@@ -998,6 +1009,7 @@ int ata_pci_acquire_resources(struct ata
 			      const char **reason)
 {
 	struct pci_dev *pdev = to_pci_dev(host_set->dev);
+	const char *name = ata_drv_name(&pdev->dev);
 	int nr_dummy, i, rc;
 
 	/* acquire generic resources */
@@ -1016,7 +1028,7 @@ int ata_pci_acquire_resources(struct ata
 		goto err;
 	}
 
-	rc = pci_request_regions(pdev, DRV_NAME);
+	rc = pci_request_regions(pdev, name);
 	if (rc) {
 		host_set->flags |= ATA_HOST_PCI_DEV_BUSY;
 		*reason = "failed to request PCI regions";
@@ -1040,7 +1052,7 @@ int ata_pci_acquire_resources(struct ata
 			continue;
 		BUG_ON(i >= host_set->n_ports);
 
-		if (ata_pci_acquire_legacy(i, &host_set->flags)) {
+		if (ata_pci_acquire_legacy(i, name, &host_set->flags)) {
 			host_set->ports[i]->ops = &ata_dummy_port_ops;
 			nr_dummy++;
 		}
@@ -1219,6 +1231,7 @@ int ata_pci_host_set_prepare(struct pci_
 	const int irq[3] = { 14, 15, pdev->irq };
 	irqreturn_t (*irq_handler[3])(int, void *,
 				      struct pt_regs *) = { NULL, NULL, NULL };
+	const char *name = ata_drv_name(&pdev->dev);
 	struct ata_host_set *host_set = NULL;
 	struct ata_port_info dummy_pinfo;
 	const struct ata_port_info *pi[2];
@@ -1309,8 +1322,8 @@ int ata_pci_host_set_prepare(struct pci_
 			break;
 		}
 
-		rc = request_irq(irq[i], irq_handler[i], irq_flags[i],
-				 DRV_NAME, host_set);
+		rc = request_irq(irq[i], irq_handler[i], irq_flags[i], name,
+				 host_set);
 		if (rc) {
 			reason = "failed to request IRQ";
 			goto err;
-- 
1.3.2


-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux