Skip to content

Commit

Permalink
Merge tag 'staging-4.9-rc3' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Linus Torvalds committed Oct 29, 2016
2 parents 37cc6bb + e866dd8 commit db4a57e
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 38 deletions.
2 changes: 2 additions & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ config STX104
config TI_ADC081C
tristate "Texas Instruments ADC081C/ADC101C/ADC121C family"
depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
If you say yes here you get support for Texas Instruments ADC081C,
ADC101C and ADC121C ADC chips.
Expand Down
7 changes: 4 additions & 3 deletions drivers/iio/chemical/atlas-ph-sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,14 @@ static int atlas_check_ec_calibration(struct atlas_data *data)
struct device *dev = &data->client->dev;
int ret;
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)
return ret;

dev_info(dev, "probe set to K = %d.%.2d", be16_to_cpu(val) / 100,
be16_to_cpu(val) % 100);
val = be16_to_cpu(rval);
dev_info(dev, "probe set to K = %d.%.2d", val / 100, val % 100);

ret = regmap_read(data->regmap, ATLAS_REG_EC_CALIB_STATUS, &val);
if (ret)
Expand Down
16 changes: 9 additions & 7 deletions drivers/iio/temperature/maxim_thermocouple.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,24 @@ static int maxim_thermocouple_read(struct maxim_thermocouple_data *data,
{
unsigned int storage_bytes = data->chip->read_size;
unsigned int shift = chan->scan_type.shift + (chan->address * 8);
unsigned int buf;
__be16 buf16;
__be32 buf32;
int ret;

ret = spi_read(data->spi, (void *) &buf, storage_bytes);
if (ret)
return ret;

switch (storage_bytes) {
case 2:
*val = be16_to_cpu(buf);
ret = spi_read(data->spi, (void *)&buf16, storage_bytes);
*val = be16_to_cpu(buf16);
break;
case 4:
*val = be32_to_cpu(buf);
ret = spi_read(data->spi, (void *)&buf32, storage_bytes);
*val = be32_to_cpu(buf32);
break;
}

if (ret)
return ret;

/* check to be sure this is a valid reading */
if (*val & data->chip->status_bit)
return -EINVAL;
Expand Down
6 changes: 4 additions & 2 deletions drivers/staging/android/ion/ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,10 @@ int ion_query_heaps(struct ion_client *client, struct ion_heap_query *query)
hdata.type = heap->type;
hdata.heap_id = heap->id;

ret = copy_to_user(&buffer[cnt],
&hdata, sizeof(hdata));
if (copy_to_user(&buffer[cnt], &hdata, sizeof(hdata))) {
ret = -EFAULT;
goto out;
}

cnt++;
if (cnt >= max_cnt)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/android/ion/ion_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
&pdev->dev);
if (!pdev)
if (!heap_pdev)
return ERR_PTR(-ENOMEM);
heap_pdev->dev.platform_data = &heaps[i];

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/greybus/arche-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state,
pdev = of_find_device_by_node(np);
if (!pdev) {
pr_err("arche-platform device not found\n");
of_node_put(np);
return -ENODEV;
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/greybus/es2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,8 @@ static int ap_probe(struct usb_interface *interface,
INIT_LIST_HEAD(&es2->arpcs);
spin_lock_init(&es2->arpc_lock);

if (es2_arpc_in_enable(es2))
retval = es2_arpc_in_enable(es2);
if (retval)
goto error;

retval = gb_hd_add(hd);
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/greybus/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,15 +702,13 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
ret = gb_gpio_irqchip_add(gpio, irqc, 0,
handle_level_irq, IRQ_TYPE_NONE);
if (ret) {
dev_err(&connection->bundle->dev,
"failed to add irq chip: %d\n", ret);
dev_err(&gbphy_dev->dev, "failed to add irq chip: %d\n", ret);
goto exit_line_free;
}

ret = gpiochip_add(gpio);
if (ret) {
dev_err(&connection->bundle->dev,
"failed to add gpio chip: %d\n", ret);
dev_err(&gbphy_dev->dev, "failed to add gpio chip: %d\n", ret);
goto exit_gpio_irqchip_remove;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/greybus/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
return module;

err_put_interfaces:
for (--i; i > 0; --i)
for (--i; i >= 0; --i)
gb_interface_put(module->interfaces[i]);

put_device(&module->dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/greybus/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
minor = alloc_minor(gb_tty);
if (minor < 0) {
if (minor == -ENOSPC) {
dev_err(&connection->bundle->dev,
dev_err(&gbphy_dev->dev,
"no more free minor numbers\n");
retval = -ENODEV;
} else {
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/accel/sca3000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ static inline int __sca3000_get_base_freq(struct sca3000_state *st,
case SCA3000_MEAS_MODE_OP_2:
*base_freq = info->option_mode_2_freq;
break;
default:
ret = -EINVAL;
}
error_ret:
return ret;
Expand Down
34 changes: 17 additions & 17 deletions drivers/staging/lustre/lustre/llite/lproc_llite.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,32 +871,32 @@ static ssize_t xattr_cache_store(struct kobject *kobj,
}
LUSTRE_RW_ATTR(xattr_cache);

static ssize_t unstable_stats_show(struct kobject *kobj,
struct attribute *attr,
char *buf)
static int ll_unstable_stats_seq_show(struct seq_file *m, void *v)
{
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kobj);
struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct cl_client_cache *cache = sbi->ll_cache;
long pages;
int mb;

pages = atomic_long_read(&cache->ccc_unstable_nr);
mb = (pages * PAGE_SIZE) >> 20;

return sprintf(buf, "unstable_check: %8d\n"
"unstable_pages: %12ld\n"
"unstable_mb: %8d\n",
cache->ccc_unstable_check, pages, mb);
seq_printf(m,
"unstable_check: %8d\n"
"unstable_pages: %12ld\n"
"unstable_mb: %8d\n",
cache->ccc_unstable_check, pages, mb);

return 0;
}

static ssize_t unstable_stats_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer,
size_t count)
static ssize_t ll_unstable_stats_seq_write(struct file *file,
const char __user *buffer,
size_t count, loff_t *off)
{
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kobj);
struct super_block *sb = ((struct seq_file *)file->private_data)->private;
struct ll_sb_info *sbi = ll_s2sbi(sb);
char kernbuf[128];
int val, rc;

Expand All @@ -922,7 +922,7 @@ static ssize_t unstable_stats_store(struct kobject *kobj,

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,
char *buf)
Expand Down Expand Up @@ -995,6 +995,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
/* { "filegroups", lprocfs_rd_filegroups, 0, 0 }, */
{ "max_cached_mb", &ll_max_cached_mb_fops, NULL },
{ "statahead_stats", &ll_statahead_stats_fops, NULL, 0 },
{ "unstable_stats", &ll_unstable_stats_fops, NULL },
{ "sbi_flags", &ll_sbi_flags_fops, NULL, 0 },
{ .name = "nosquash_nids",
.fops = &ll_nosquash_nids_fops },
Expand Down Expand Up @@ -1026,7 +1027,6 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_max_easize.attr,
&lustre_attr_default_easize.attr,
&lustre_attr_xattr_cache.attr,
&lustre_attr_unstable_stats.attr,
&lustre_attr_root_squash.attr,
NULL,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/wilc1000/host_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -3388,7 +3388,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)

clients_count++;

destroy_workqueue(hif_workqueue);
_fail_:
return result;
}
Expand Down

0 comments on commit db4a57e

Please sign in to comment.