struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
struct property *sas_addr_prop;
- int num;
shost = scsi_host_alloc(&hisi_sas_sht, sizeof(*hisi_hba));
if (!shost)
if (of_property_read_u32(np, "queue-count", &hisi_hba->queue_count))
goto err_out;
- num = of_irq_count(np);
- hisi_hba->int_names = devm_kcalloc(dev, num,
- HISI_SAS_NAME_LEN,
- GFP_KERNEL);
- if (!hisi_hba->int_names)
- goto err_out;
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hisi_hba->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(hisi_hba->regs))
return IRQ_HANDLED;
}
-static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = {
- {"Bcast"},
- {"Phy Up"},
- {"Abnormal"},
-};
-
-static const char cq_int_name[32] = "cq";
-static const char fatal_int_name[HISI_SAS_FATAL_INT_NR][32] = {
- "fatal ecc",
- "fatal axi"
-};
-
static irq_handler_t phy_interrupts[HISI_SAS_PHY_INT_NR] = {
int_bcast_v1_hw,
int_phyup_v1_hw,
{
struct device *dev = &hisi_hba->pdev->dev;
struct device_node *np = dev->of_node;
- char *int_names = hisi_hba->int_names;
int i, j, irq, rc, idx;
if (!np)
return -ENOENT;
}
- (void)snprintf(&int_names[idx * HISI_SAS_NAME_LEN],
- HISI_SAS_NAME_LEN,
- "%s %s:%d", dev_name(dev),
- phy_int_names[j], i);
rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
- &int_names[idx * HISI_SAS_NAME_LEN],
- phy);
+ DRV_NAME " phy", phy);
if (rc) {
dev_err(dev, "irq init: could not request "
"phy interrupt %d, rc=%d\n",
idx);
return -ENOENT;
}
- (void)snprintf(&int_names[idx * HISI_SAS_NAME_LEN],
- HISI_SAS_NAME_LEN,
- "%s %s:%d", dev_name(dev), cq_int_name, i);
+
rc = devm_request_irq(dev, irq, cq_interrupt_v1_hw, 0,
- &int_names[idx * HISI_SAS_NAME_LEN],
- &hisi_hba->cq[i]);
+ DRV_NAME " cq", &hisi_hba->cq[i]);
if (rc) {
dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
irq, rc);
idx);
return -ENOENT;
}
- (void)snprintf(&int_names[idx * HISI_SAS_NAME_LEN],
- HISI_SAS_NAME_LEN,
- "%s %s:%d", dev_name(dev), fatal_int_name[i], i);
+
rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
- &int_names[idx * HISI_SAS_NAME_LEN],
- hisi_hba);
+ DRV_NAME " fatal", hisi_hba);
if (rc) {
dev_err(dev,
"irq init: could not request fatal interrupt %d, rc=%d\n",