aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qlogicpti.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-10-28 16:26:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-28 16:26:37 -0400
commitf7e8d9f830b118cfe757140d910834afd1710001 (patch)
treec79b3f072d7811a12a543ffb291f5fb52c274521 /drivers/scsi/qlogicpti.c
parent1df35f80f9d3bba7cd434b64c9eaff8c9109abad (diff)
qlogicpti: Fix build warning.
The build warns: drivers/scsi/qlogicpti.c: In function 'qpti_sbus_probe': drivers/scsi/qlogicpti.c:1316:45: warning: passing argument 1 of 'scsi_host_alloc' discards 'const' qualifier from pointer target type [enabled by default] include/scsi/scsi_host.h:778:26: note: expected 'struct scsi_host_template *' but argument is of type 'const struct scsi_host_template *' The problem is that of_device_id->data is a const void pointer. This is pretty silly in this specific instance, because for all matched device IDs we set match->data to the same value, &qpti_template. So just use that directly instead of the unnecessary and improperly typed abstraction. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/qlogicpti.c')
-rw-r--r--drivers/scsi/qlogicpti.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index b191dd549207..71fddbc60f18 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1294,26 +1294,19 @@ static struct scsi_host_template qpti_template = {
1294static const struct of_device_id qpti_match[]; 1294static const struct of_device_id qpti_match[];
1295static int __devinit qpti_sbus_probe(struct platform_device *op) 1295static int __devinit qpti_sbus_probe(struct platform_device *op)
1296{ 1296{
1297 const struct of_device_id *match;
1298 struct scsi_host_template *tpnt;
1299 struct device_node *dp = op->dev.of_node; 1297 struct device_node *dp = op->dev.of_node;
1300 struct Scsi_Host *host; 1298 struct Scsi_Host *host;
1301 struct qlogicpti *qpti; 1299 struct qlogicpti *qpti;
1302 static int nqptis; 1300 static int nqptis;
1303 const char *fcode; 1301 const char *fcode;
1304 1302
1305 match = of_match_device(qpti_match, &op->dev);
1306 if (!match)
1307 return -EINVAL;
1308 tpnt = match->data;
1309
1310 /* Sometimes Antares cards come up not completely 1303 /* Sometimes Antares cards come up not completely
1311 * setup, and we get a report of a zero IRQ. 1304 * setup, and we get a report of a zero IRQ.
1312 */ 1305 */
1313 if (op->archdata.irqs[0] == 0) 1306 if (op->archdata.irqs[0] == 0)
1314 return -ENODEV; 1307 return -ENODEV;
1315 1308
1316 host = scsi_host_alloc(tpnt, sizeof(struct qlogicpti)); 1309 host = scsi_host_alloc(&qpti_template, sizeof(struct qlogicpti));
1317 if (!host) 1310 if (!host)
1318 return -ENOMEM; 1311 return -ENOMEM;
1319 1312
@@ -1445,19 +1438,15 @@ static int __devexit qpti_sbus_remove(struct platform_device *op)
1445static const struct of_device_id qpti_match[] = { 1438static const struct of_device_id qpti_match[] = {
1446 { 1439 {
1447 .name = "ptisp", 1440 .name = "ptisp",
1448 .data = &qpti_template,
1449 }, 1441 },
1450 { 1442 {
1451 .name = "PTI,ptisp", 1443 .name = "PTI,ptisp",
1452 .data = &qpti_template,
1453 }, 1444 },
1454 { 1445 {
1455 .name = "QLGC,isp", 1446 .name = "QLGC,isp",
1456 .data = &qpti_template,
1457 }, 1447 },
1458 { 1448 {
1459 .name = "SUNW,isp", 1449 .name = "SUNW,isp",
1460 .data = &qpti_template,
1461 }, 1450 },
1462 {}, 1451 {},
1463}; 1452};