Re: [PATCH 7/24] advansys: Convert to EISA driver model

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

 



Matthew Wilcox wrote:
+static int __devinit advansys_eisa_probe(struct device *dev)
+{
+	int i, ioport;
+	int err;
+	struct eisa_device *edev = to_eisa_device(dev);
+	struct eisa_scsi_data *data;
+
+	err = -ENOMEM;
+	data = kzalloc(sizeof(*data), GFP_KERNEL);
+	if (!data)
+		goto fail;
+	ioport = edev->base_addr + 0xc30;
+
+	err = -ENODEV;
+	for (i = 0; i < 2; i++, ioport += 0x20) {
+		if (!AscFindSignature(ioport))
+			continue;
+		inw(ioport + 4);
+		data->host[i] = advansys_board_found(ioport, dev, ASC_IS_EISA);
+		if (data->host[i])
+			err = 0;
+	}
+
+	if (err) {
+		kfree(data);
+	} else {
+		dev_set_drvdata(dev, data);
+	}

Same nit as with PCI: recommend keeping the non-error path at the lowest indentation level for future-proof-ness and easy review.


+static __devexit int advansys_eisa_remove(struct device *dev)
+{
+	int i, ioport;
+	struct eisa_scsi_data *data = dev_get_drvdata(dev);
+
+	for (i = 0; i < 2; i++) {
+		struct Scsi_Host *shost = data->host[i];
+		if (!shost)
+			continue;
+		ioport = shost->io_port;
+		advansys_remove(data->host[i]);

what is the point of assigning ioport a never-used value?


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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux