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

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

staging: comedi: pass struct comedi_driver * to comedi_auto_config()



Pass a pointer to the struct comedi_driver to comedi_auto_config()
instead of the driver name.  comedi_auto_config() will be changed to
make use of this.  It currently calls comedi_device_attach() which
examines the whole list of struct comedi_driver objects.  It will be
changed to restrict itself to just the supplied struct comedi_driver
object.

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4011670
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -857,7 +857,7 @@ comedi_auto_config_helper(struct device *hardware_device,
}
}


static int comedi_auto_config(struct device *hardware_device,
static int comedi_auto_config(struct device *hardware_device,
			      const char *board_name, const int *options,
			      struct comedi_driver *driver, const int *options,
			      unsigned num_options)
			      unsigned num_options)
{
{
	struct comedi_devconfig it;
	struct comedi_devconfig it;
@@ -875,7 +875,7 @@ static int comedi_auto_config(struct device *hardware_device,
	dev_file_info = comedi_get_device_file_info(minor);
	dev_file_info = comedi_get_device_file_info(minor);


	memset(&it, 0, sizeof(it));
	memset(&it, 0, sizeof(it));
	strncpy(it.board_name, board_name, COMEDI_NAMELEN);
	strncpy(it.board_name, driver->driver_name, COMEDI_NAMELEN);
	it.board_name[COMEDI_NAMELEN - 1] = '\0';
	it.board_name[COMEDI_NAMELEN - 1] = '\0';
	BUG_ON(num_options > COMEDI_NDEVCONFOPTS);
	BUG_ON(num_options > COMEDI_NDEVCONFOPTS);
	memcpy(it.options, options, num_options * sizeof(int));
	memcpy(it.options, options, num_options * sizeof(int));
@@ -912,7 +912,7 @@ static int comedi_old_pci_auto_config(struct pci_dev *pcidev,
	/*  pci slot */
	/*  pci slot */
	options[1] = PCI_SLOT(pcidev->devfn);
	options[1] = PCI_SLOT(pcidev->devfn);


	return comedi_auto_config(&pcidev->dev, driver->driver_name,
	return comedi_auto_config(&pcidev->dev, driver,
				  options, ARRAY_SIZE(options));
				  options, ARRAY_SIZE(options));
}
}


@@ -947,7 +947,7 @@ EXPORT_SYMBOL_GPL(comedi_pci_auto_unconfig);
static int comedi_old_usb_auto_config(struct usb_interface *intf,
static int comedi_old_usb_auto_config(struct usb_interface *intf,
				      struct comedi_driver *driver)
				      struct comedi_driver *driver)
{
{
	return comedi_auto_config(&intf->dev, driver->driver_name, NULL, 0);
	return comedi_auto_config(&intf->dev, driver, NULL, 0);
}
}


static int comedi_usb_attach_wrapper(struct comedi_device *dev, void *intf)
static int comedi_usb_attach_wrapper(struct comedi_device *dev, void *intf)