Commit db4a57e6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'staging-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO driver fixes from Greg KH:
 "Here are some small staging and iio driver fixes for reported issues
  for 4.9-rc3. Nothing major, the "largest" being a lustre fix for a
  sysfs file that was obviously wrong, and had never been tested, so it
  was moved to debugfs as that is where it belongs. The others are small
  bug fixes for reported issues with various staging or iio drivers.

  All have been in linux-next for a while with no reported issues"

* tag 'staging-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  greybus: fix a leak on error in gb_module_create()
  greybus: es2: fix error return code in ap_probe()
  greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()
  staging: android: ion: Fix error handling in ion_query_heaps()
  iio: accel: sca3000_core: avoid potentially uninitialized variable
  iio:chemical:atlas-ph-sensor: Fix use of 32 bit int to hold 16 bit big endian value
  staging/lustre/llite: Move unstable_stats from sysfs to debugfs
  Staging: wilc1000: Fix kernel Oops on opening the device
  staging: android/ion: testing the wrong variable
  Staging: greybus: uart: Use gbphy_dev->dev instead of bundle->dev
  Staging: greybus: gpio: Use gbphy_dev->dev instead of bundle->dev
  iio: adc: ti-adc081c: Select IIO_TRIGGERED_BUFFER to prevent build errors
  iio: maxim_thermocouple: Align 16 bit big endian value of raw reads
parents 37cc6bb8 e866dd8a
...@@ -437,6 +437,8 @@ config STX104 ...@@ -437,6 +437,8 @@ config STX104
config TI_ADC081C config TI_ADC081C
tristate "Texas Instruments ADC081C/ADC101C/ADC121C family" tristate "Texas Instruments ADC081C/ADC101C/ADC121C family"
depends on I2C depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help help
If you say yes here you get support for Texas Instruments ADC081C, If you say yes here you get support for Texas Instruments ADC081C,
ADC101C and ADC121C ADC chips. ADC101C and ADC121C ADC chips.
......
...@@ -213,13 +213,14 @@ static int atlas_check_ec_calibration(struct atlas_data *data) ...@@ -213,13 +213,14 @@ static int atlas_check_ec_calibration(struct atlas_data *data)
struct device *dev = &data->client->dev; struct device *dev = &data->client->dev;
int ret; int ret;
unsigned int val; unsigned int val;
__be16 rval;
ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &val, 2); ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &rval, 2);
if (ret) if (ret)
return ret; return ret;
dev_info(dev, "probe set to K = %d.%.2d", be16_to_cpu(val) / 100, val = be16_to_cpu(rval);
be16_to_cpu(val) % 100); dev_info(dev, "probe set to K = %d.%.2d", val / 100, val % 100);
ret = regmap_read(data->regmap, ATLAS_REG_EC_CALIB_STATUS, &val); ret = regmap_read(data->regmap, ATLAS_REG_EC_CALIB_STATUS, &val);
if (ret) if (ret)
......
...@@ -123,22 +123,24 @@ static int maxim_thermocouple_read(struct maxim_thermocouple_data *data, ...@@ -123,22 +123,24 @@ static int maxim_thermocouple_read(struct maxim_thermocouple_data *data,
{ {
unsigned int storage_bytes = data->chip->read_size; unsigned int storage_bytes = data->chip->read_size;
unsigned int shift = chan->scan_type.shift + (chan->address * 8); unsigned int shift = chan->scan_type.shift + (chan->address * 8);
unsigned int buf; __be16 buf16;
__be32 buf32;
int ret; int ret;
ret = spi_read(data->spi, (void *) &buf, storage_bytes);
if (ret)
return ret;
switch (storage_bytes) { switch (storage_bytes) {
case 2: case 2:
*val = be16_to_cpu(buf); ret = spi_read(data->spi, (void *)&buf16, storage_bytes);
*val = be16_to_cpu(buf16);
break; break;
case 4: case 4:
*val = be32_to_cpu(buf); ret = spi_read(data->spi, (void *)&buf32, storage_bytes);
*val = be32_to_cpu(buf32);
break; break;
} }
if (ret)
return ret;
/* check to be sure this is a valid reading */ /* check to be sure this is a valid reading */
if (*val & data->chip->status_bit) if (*val & data->chip->status_bit)
return -EINVAL; return -EINVAL;
......
...@@ -1187,8 +1187,10 @@ int ion_query_heaps(struct ion_client *client, struct ion_heap_query *query) ...@@ -1187,8 +1187,10 @@ int ion_query_heaps(struct ion_client *client, struct ion_heap_query *query)
hdata.type = heap->type; hdata.type = heap->type;
hdata.heap_id = heap->id; hdata.heap_id = heap->id;
ret = copy_to_user(&buffer[cnt], if (copy_to_user(&buffer[cnt], &hdata, sizeof(hdata))) {
&hdata, sizeof(hdata)); ret = -EFAULT;
goto out;
}
cnt++; cnt++;
if (cnt >= max_cnt) if (cnt >= max_cnt)
......
...@@ -107,7 +107,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev, ...@@ -107,7 +107,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
heap_pdev = of_platform_device_create(node, heaps[i].name, heap_pdev = of_platform_device_create(node, heaps[i].name,
&pdev->dev); &pdev->dev);
if (!pdev) if (!heap_pdev)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
heap_pdev->dev.platform_data = &heaps[i]; heap_pdev->dev.platform_data = &heaps[i];
......
...@@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state, ...@@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state,
pdev = of_find_device_by_node(np); pdev = of_find_device_by_node(np);
if (!pdev) { if (!pdev) {
pr_err("arche-platform device not found\n"); pr_err("arche-platform device not found\n");
of_node_put(np);
return -ENODEV; return -ENODEV;
} }
......
...@@ -1548,7 +1548,8 @@ static int ap_probe(struct usb_interface *interface, ...@@ -1548,7 +1548,8 @@ static int ap_probe(struct usb_interface *interface,
INIT_LIST_HEAD(&es2->arpcs); INIT_LIST_HEAD(&es2->arpcs);
spin_lock_init(&es2->arpc_lock); spin_lock_init(&es2->arpc_lock);
if (es2_arpc_in_enable(es2)) retval = es2_arpc_in_enable(es2);
if (retval)
goto error; goto error;
retval = gb_hd_add(hd); retval = gb_hd_add(hd);
......
...@@ -702,15 +702,13 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev, ...@@ -702,15 +702,13 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
ret = gb_gpio_irqchip_add(gpio, irqc, 0, ret = gb_gpio_irqchip_add(gpio, irqc, 0,
handle_level_irq, IRQ_TYPE_NONE); handle_level_irq, IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_err(&connection->bundle->dev, dev_err(&gbphy_dev->dev, "failed to add irq chip: %d\n", ret);
"failed to add irq chip: %d\n", ret);
goto exit_line_free; goto exit_line_free;
} }
ret = gpiochip_add(gpio); ret = gpiochip_add(gpio);
if (ret) { if (ret) {
dev_err(&connection->bundle->dev, dev_err(&gbphy_dev->dev, "failed to add gpio chip: %d\n", ret);
"failed to add gpio chip: %d\n", ret);
goto exit_gpio_irqchip_remove; goto exit_gpio_irqchip_remove;
} }
......
...@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id, ...@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
return module; return module;
err_put_interfaces: err_put_interfaces:
for (--i; i > 0; --i) for (--i; i >= 0; --i)
gb_interface_put(module->interfaces[i]); gb_interface_put(module->interfaces[i]);
put_device(&module->dev); put_device(&module->dev);
......
...@@ -888,7 +888,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev, ...@@ -888,7 +888,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
minor = alloc_minor(gb_tty); minor = alloc_minor(gb_tty);
if (minor < 0) { if (minor < 0) {
if (minor == -ENOSPC) { if (minor == -ENOSPC) {
dev_err(&connection->bundle->dev, dev_err(&gbphy_dev->dev,
"no more free minor numbers\n"); "no more free minor numbers\n");
retval = -ENODEV; retval = -ENODEV;
} else { } else {
......
...@@ -468,6 +468,8 @@ static inline int __sca3000_get_base_freq(struct sca3000_state *st, ...@@ -468,6 +468,8 @@ static inline int __sca3000_get_base_freq(struct sca3000_state *st,
case SCA3000_MEAS_MODE_OP_2: case SCA3000_MEAS_MODE_OP_2:
*base_freq = info->option_mode_2_freq; *base_freq = info->option_mode_2_freq;
break; break;
default:
ret = -EINVAL;
} }
error_ret: error_ret:
return ret; return ret;
......
...@@ -871,12 +871,10 @@ static ssize_t xattr_cache_store(struct kobject *kobj, ...@@ -871,12 +871,10 @@ static ssize_t xattr_cache_store(struct kobject *kobj,
} }
LUSTRE_RW_ATTR(xattr_cache); LUSTRE_RW_ATTR(xattr_cache);
static ssize_t unstable_stats_show(struct kobject *kobj, static int ll_unstable_stats_seq_show(struct seq_file *m, void *v)
struct attribute *attr,
char *buf)
{ {
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, struct super_block *sb = m->private;
ll_kobj); struct ll_sb_info *sbi = ll_s2sbi(sb);
struct cl_client_cache *cache = sbi->ll_cache; struct cl_client_cache *cache = sbi->ll_cache;
long pages; long pages;
int mb; int mb;
...@@ -884,19 +882,21 @@ static ssize_t unstable_stats_show(struct kobject *kobj, ...@@ -884,19 +882,21 @@ static ssize_t unstable_stats_show(struct kobject *kobj,
pages = atomic_long_read(&cache->ccc_unstable_nr); pages = atomic_long_read(&cache->ccc_unstable_nr);
mb = (pages * PAGE_SIZE) >> 20; mb = (pages * PAGE_SIZE) >> 20;
return sprintf(buf, "unstable_check: %8d\n" seq_printf(m,
"unstable_pages: %12ld\n" "unstable_check: %8d\n"
"unstable_mb: %8d\n", "unstable_pages: %12ld\n"
cache->ccc_unstable_check, pages, mb); "unstable_mb: %8d\n",
cache->ccc_unstable_check, pages, mb);
return 0;
} }
static ssize_t unstable_stats_store(struct kobject *kobj, static ssize_t ll_unstable_stats_seq_write(struct file *file,
struct attribute *attr, const char __user *buffer,
const char *buffer, size_t count, loff_t *off)
size_t count)
{ {
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, struct super_block *sb = ((struct seq_file *)file->private_data)->private;
ll_kobj); struct ll_sb_info *sbi = ll_s2sbi(sb);
char kernbuf[128]; char kernbuf[128];
int val, rc; int val, rc;
...@@ -922,7 +922,7 @@ static ssize_t unstable_stats_store(struct kobject *kobj, ...@@ -922,7 +922,7 @@ static ssize_t unstable_stats_store(struct kobject *kobj,
return count; return count;
} }
LUSTRE_RW_ATTR(unstable_stats); LPROC_SEQ_FOPS(ll_unstable_stats);
static ssize_t root_squash_show(struct kobject *kobj, struct attribute *attr, static ssize_t root_squash_show(struct kobject *kobj, struct attribute *attr,
char *buf) char *buf)
...@@ -995,6 +995,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = { ...@@ -995,6 +995,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
/* { "filegroups", lprocfs_rd_filegroups, 0, 0 }, */ /* { "filegroups", lprocfs_rd_filegroups, 0, 0 }, */
{ "max_cached_mb", &ll_max_cached_mb_fops, NULL }, { "max_cached_mb", &ll_max_cached_mb_fops, NULL },
{ "statahead_stats", &ll_statahead_stats_fops, NULL, 0 }, { "statahead_stats", &ll_statahead_stats_fops, NULL, 0 },
{ "unstable_stats", &ll_unstable_stats_fops, NULL },
{ "sbi_flags", &ll_sbi_flags_fops, NULL, 0 }, { "sbi_flags", &ll_sbi_flags_fops, NULL, 0 },
{ .name = "nosquash_nids", { .name = "nosquash_nids",
.fops = &ll_nosquash_nids_fops }, .fops = &ll_nosquash_nids_fops },
...@@ -1026,7 +1027,6 @@ static struct attribute *llite_attrs[] = { ...@@ -1026,7 +1027,6 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_max_easize.attr, &lustre_attr_max_easize.attr,
&lustre_attr_default_easize.attr, &lustre_attr_default_easize.attr,
&lustre_attr_xattr_cache.attr, &lustre_attr_xattr_cache.attr,
&lustre_attr_unstable_stats.attr,
&lustre_attr_root_squash.attr, &lustre_attr_root_squash.attr,
NULL, NULL,
}; };
......
...@@ -3388,7 +3388,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3388,7 +3388,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
clients_count++; clients_count++;
destroy_workqueue(hif_workqueue);
_fail_: _fail_:
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment