Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e067666a authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: amplc_dio200: remove dio200_report_attach()



`dio200_report_attach()` is called from `dio200_common_attach()` to
report the successful attachment of a supported board.  It includes
various information about the board.  Replace the function with a simple
acknowledgement that the attachment completed successfully.  The
`dio200_attach()` and `dio200_auto_attach()` functions also output an
message during the attachment.  Include extra information in those
messages to compensate for the removal of the information output by
`dio200_report_attach()`.

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 207c3b2b
Loading
Loading
Loading
Loading
+7 −32
Original line number Diff line number Diff line
@@ -1698,32 +1698,6 @@ static int dio200_pcie_board_setup(struct comedi_device *dev)
	return 0;
}

static void dio200_report_attach(struct comedi_device *dev, unsigned int irq)
{
	const struct dio200_board *thisboard = comedi_board(dev);
	struct dio200_private *devpriv = dev->private;
	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
	char tmpbuf[60];
	int tmplen;

	if (is_isa_board(thisboard))
		tmplen = scnprintf(tmpbuf, sizeof(tmpbuf),
				   "(base %#lx) ", devpriv->io.u.iobase);
	else if (is_pci_board(thisboard))
		tmplen = scnprintf(tmpbuf, sizeof(tmpbuf),
				   "(pci %s) ", pci_name(pcidev));
	else
		tmplen = 0;
	if (irq)
		tmplen += scnprintf(&tmpbuf[tmplen], sizeof(tmpbuf) - tmplen,
				    "(irq %u%s) ", irq,
				    (dev->irq ? "" : " UNAVAILABLE"));
	else
		tmplen += scnprintf(&tmpbuf[tmplen], sizeof(tmpbuf) - tmplen,
				    "(no irq) ");
	dev_info(dev->class_dev, "%s %sattached\n", dev->board_name, tmpbuf);
}

static int dio200_common_attach(struct comedi_device *dev, unsigned int irq,
				unsigned long req_irq_flags)
{
@@ -1799,7 +1773,7 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned int irq,
				 "warning! irq %u unavailable!\n", irq);
		}
	}
	dio200_report_attach(dev, irq);
	dev_info(dev->class_dev, "attached\n");
	return 0;
}

@@ -1816,15 +1790,16 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
		return -EINVAL;

	dev->board_name = thisboard->name;
	dev_info(dev->class_dev, "%s: attach\n", dev->driver->driver_name);
	iobase = it->options[0];
	irq = it->options[1];
	dev_info(dev->class_dev, "%s: attach %s 0x%lX,%u\n",
		 dev->driver->driver_name, dev->board_name, iobase, irq);

	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	if (!devpriv)
		return -ENOMEM;
	dev->private = devpriv;

	iobase = it->options[0];
	irq = it->options[1];
	ret = dio200_request_region(dev, iobase, thisboard->mainsize);
	if (ret < 0)
		return ret;
@@ -1858,8 +1833,8 @@ static int dio200_auto_attach(struct comedi_device *dev,
	dev->board_ptr = thisboard;
	dev->board_name = thisboard->name;

	dev_info(dev->class_dev, "%s: attach pci %s\n",
		 dev->driver->driver_name, pci_name(pci_dev));
	dev_info(dev->class_dev, "%s: attach pci %s (%s)\n",
		 dev->driver->driver_name, pci_name(pci_dev), dev->board_name);

	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	if (!devpriv)