From: Greg Kroah-Hartman Date: Mon, 7 Jan 2013 23:17:52 +0000 (-0800) Subject: Merge branch 'staging-linus' into staging-next X-Git-Tag: firefly_0821_release~3680^2~1080^2~495 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=17cb3be61b45d716f6b21a9380925493413ce0ed;p=firefly-linux-kernel-4.4.55.git Merge branch 'staging-linus' into staging-next This is to get the comedi fixes, and resolve the issue in comdi_test.c and comedi_fops.c that were caused by changes in both branches. It also allows the fwserial driver changes to be applied, as they required the fixes that are in staging-linus. Signed-off-by: Greg Kroah-Hartman --- 17cb3be61b45d716f6b21a9380925493413ce0ed diff --cc drivers/iio/adc/max1363.c index 0ba4fea960ac,31f3485303d0..aac572290cbf --- a/drivers/iio/adc/max1363.c +++ b/drivers/iio/adc/max1363.c @@@ -1558,13 -1605,14 +1558,12 @@@ static int __devinit max1363_probe(stru return 0; error_free_irq: - free_irq(st->client->irq, indio_dev); + if (client->irq) + free_irq(st->client->irq, indio_dev); error_uninit_buffer: - iio_buffer_unregister(indio_dev); -error_cleanup_buffer: - max1363_buffer_cleanup(indio_dev); + iio_triggered_buffer_cleanup(indio_dev); error_free_available_scan_masks: kfree(indio_dev->available_scan_masks); - error_unregister_map: - iio_map_array_unregister(indio_dev, client->dev.platform_data); error_disable_reg: regulator_disable(st->reg); error_put_reg: @@@ -1583,12 -1633,11 +1584,10 @@@ static int __devexit max1363_remove(str iio_device_unregister(indio_dev); if (client->irq) free_irq(st->client->irq, indio_dev); - iio_buffer_unregister(indio_dev); - max1363_buffer_cleanup(indio_dev); + iio_triggered_buffer_cleanup(indio_dev); kfree(indio_dev->available_scan_masks); - if (!IS_ERR(st->reg)) { - regulator_disable(st->reg); - regulator_put(st->reg); - } + regulator_disable(st->reg); + regulator_put(st->reg); iio_map_array_unregister(indio_dev, client->dev.platform_data); iio_device_free(indio_dev); diff --cc drivers/staging/comedi/comedi_fops.c index 2fd577fa941e,9b038e4a7e71..cd2c7d40d4db --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@@ -1647,11 -1533,14 +1647,12 @@@ static long comedi_unlocked_ioctl(struc unsigned long arg) { const unsigned minor = iminor(file->f_dentry->d_inode); - struct comedi_device_file_info *dev_file_info = - comedi_get_device_file_info(minor); - struct comedi_device *dev; + struct comedi_device *dev = comedi_dev_from_minor(minor); ++ struct comedi_file_info *info = comedi_file_info_from_minor(minor); int rc; - if (dev_file_info == NULL || dev_file_info->device == NULL) + if (!dev) return -ENODEV; - dev = dev_file_info->device; mutex_lock(&dev->mutex); @@@ -1660,6 -1549,9 +1661,9 @@@ if (cmd == COMEDI_DEVCONFIG) { rc = do_devconfig_ioctl(dev, (struct comedi_devconfig __user *)arg); + if (rc == 0) + /* Evade comedi_auto_unconfig(). */ - dev_file_info->hardware_device = NULL; ++ info->hardware_device = NULL; goto done; }