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

Commit 398e6f12 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: adv_pci1710: remove unnecessary 'valid'



The 'valid' variable in the private data is only used in the
detach of the board to determine if the pci1710_reset() function
can be called. That function only requires a valid dev->iobase
to work. Use that for the check instead and remove the unneeded
variable from the private data.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f62608e3
Loading
Loading
Loading
Loading
+4 −10
Original line number Original line Diff line number Diff line
@@ -300,7 +300,6 @@ static const struct boardtype boardtypes[] = {
};
};


struct pci1710_private {
struct pci1710_private {
	char valid;		/*  card is usable */
	char neverending_ai;	/*  we do unlimited AI */
	char neverending_ai;	/*  we do unlimited AI */
	unsigned int CntrlReg;	/*  Control register */
	unsigned int CntrlReg;	/*  Control register */
	unsigned int i8254_osc_base;	/*  frequence of onboard oscilator */
	unsigned int i8254_osc_base;	/*  frequence of onboard oscilator */
@@ -1433,8 +1432,6 @@ static int pci1710_attach_pci(struct comedi_device *dev,
		subdev++;
		subdev++;
	}
	}


	devpriv->valid = 1;

	dev_info(dev->class_dev, "%s attached, irq %sabled\n",
	dev_info(dev->class_dev, "%s attached, irq %sabled\n",
		dev->board_name, dev->irq ? "en" : "dis");
		dev->board_name, dev->irq ? "en" : "dis");


@@ -1443,15 +1440,12 @@ static int pci1710_attach_pci(struct comedi_device *dev,


static void pci1710_detach(struct comedi_device *dev)
static void pci1710_detach(struct comedi_device *dev)
{
{
	struct pci1710_private *devpriv = dev->private;
	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
	struct pci_dev *pcidev = comedi_to_pci_dev(dev);


	if (devpriv) {
	if (dev->iobase)
		if (devpriv->valid)
		pci1710_reset(dev);
		pci1710_reset(dev);
	if (dev->irq)
	if (dev->irq)
		free_irq(dev->irq, dev);
		free_irq(dev->irq, dev);
	}
	if (pcidev) {
	if (pcidev) {
		if (dev->iobase)
		if (dev->iobase)
			comedi_pci_disable(pcidev);
			comedi_pci_disable(pcidev);