Commit 91aff98b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'staging-4.11-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver fixes from Greg KH:
 "Here are a few small staging and IIO driver fixes for issues that
  showed up after the big set if changes you merged last week.

  Nothing major, just small bugs resolved in some IIO drivers, a lustre
  allocation fix, and some RaspberryPi driver fixes for reported
  problems, as well as a MAINTAINERS entry update.

  All of these have been in linux-next for a week with no reported
  issues"

* tag 'staging-4.11-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: fsl-mc: fix warning in DT ranges parser
  MAINTAINERS: Remove Noralf Trønnes as fbtft maintainer
  staging: vchiq_2835_arm: Make cache-line-size a required DT property
  staging: bcm2835/mmal-vchiq: unlock on error in buffer_from_host()
  staging/lustre/lnet: Fix allocation size for sv_cpt_data
  iio: adc: xilinx: Fix error handling
  iio: 104-quad-8: Fix off-by-one error when addressing flag register
  iio: adc: handle unknow of_device_id data
parents 33a8b3e9 a45e47f4
...@@ -5034,7 +5034,6 @@ F: lib/fault-inject.c ...@@ -5034,7 +5034,6 @@ F: lib/fault-inject.c
FBTFT Framebuffer drivers FBTFT Framebuffer drivers
M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
M: Noralf Trønnes <noralf@tronnes.org>
S: Maintained S: Maintained
F: drivers/staging/fbtft/ F: drivers/staging/fbtft/
......
...@@ -336,7 +336,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) ...@@ -336,7 +336,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
struct device_node *child; struct device_node *child;
struct regulator *vref; struct regulator *vref;
unsigned int reg; unsigned int reg;
unsigned int adcmode, childmode; unsigned int adcmode = -1, childmode;
unsigned int sample_width; unsigned int sample_width;
unsigned int num_channels; unsigned int num_channels;
int ret, first = 1; int ret, first = 1;
...@@ -366,6 +366,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) ...@@ -366,6 +366,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
channels = rcar_gyroadc_iio_channels_3; channels = rcar_gyroadc_iio_channels_3;
num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3); num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3);
break; break;
default:
return -EINVAL;
} }
/* /*
......
...@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)
ret = xadc->ops->setup(pdev, indio_dev, irq); ret = xadc->ops->setup(pdev, indio_dev, irq);
if (ret) if (ret)
goto err_free_samplerate_trigger; goto err_clk_disable_unprepare;
ret = request_irq(irq, xadc->ops->interrupt_handler, 0, ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
dev_name(&pdev->dev), indio_dev); dev_name(&pdev->dev), indio_dev);
...@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
err_free_irq: err_free_irq:
free_irq(irq, indio_dev); free_irq(irq, indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_free_samplerate_trigger: err_free_samplerate_trigger:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED) if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_trigger_free(xadc->samplerate_trigger); iio_trigger_free(xadc->samplerate_trigger);
...@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
err_triggered_buffer_cleanup: err_triggered_buffer_cleanup:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED) if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_device_free: err_device_free:
kfree(indio_dev->channels); kfree(indio_dev->channels);
......
...@@ -76,7 +76,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev, ...@@ -76,7 +76,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT; return IIO_VAL_INT;
} }
flags = inb(base_offset); flags = inb(base_offset + 1);
borrow = flags & BIT(0); borrow = flags & BIT(0);
carry = !!(flags & BIT(1)); carry = !!(flags & BIT(1));
......
...@@ -588,8 +588,7 @@ static int parse_mc_ranges(struct device *dev, ...@@ -588,8 +588,7 @@ static int parse_mc_ranges(struct device *dev,
int *paddr_cells, int *paddr_cells,
int *mc_addr_cells, int *mc_addr_cells,
int *mc_size_cells, int *mc_size_cells,
const __be32 **ranges_start, const __be32 **ranges_start)
u8 *num_ranges)
{ {
const __be32 *prop; const __be32 *prop;
int range_tuple_cell_count; int range_tuple_cell_count;
...@@ -602,8 +601,6 @@ static int parse_mc_ranges(struct device *dev, ...@@ -602,8 +601,6 @@ static int parse_mc_ranges(struct device *dev,
dev_warn(dev, dev_warn(dev,
"missing or empty ranges property for device tree node '%s'\n", "missing or empty ranges property for device tree node '%s'\n",
mc_node->name); mc_node->name);
*num_ranges = 0;
return 0; return 0;
} }
...@@ -630,8 +627,7 @@ static int parse_mc_ranges(struct device *dev, ...@@ -630,8 +627,7 @@ static int parse_mc_ranges(struct device *dev,
return -EINVAL; return -EINVAL;
} }
*num_ranges = ranges_len / tuple_len; return ranges_len / tuple_len;
return 0;
} }
static int get_mc_addr_translation_ranges(struct device *dev, static int get_mc_addr_translation_ranges(struct device *dev,
...@@ -639,7 +635,7 @@ static int get_mc_addr_translation_ranges(struct device *dev, ...@@ -639,7 +635,7 @@ static int get_mc_addr_translation_ranges(struct device *dev,
**ranges, **ranges,
u8 *num_ranges) u8 *num_ranges)
{ {
int error; int ret;
int paddr_cells; int paddr_cells;
int mc_addr_cells; int mc_addr_cells;
int mc_size_cells; int mc_size_cells;
...@@ -647,16 +643,16 @@ static int get_mc_addr_translation_ranges(struct device *dev, ...@@ -647,16 +643,16 @@ static int get_mc_addr_translation_ranges(struct device *dev,
const __be32 *ranges_start; const __be32 *ranges_start;
const __be32 *cell; const __be32 *cell;
error = parse_mc_ranges(dev, ret = parse_mc_ranges(dev,
&paddr_cells, &paddr_cells,
&mc_addr_cells, &mc_addr_cells,
&mc_size_cells, &mc_size_cells,
&ranges_start, &ranges_start);
num_ranges); if (ret < 0)
if (error < 0) return ret;
return error;
if (!(*num_ranges)) { *num_ranges = ret;
if (!ret) {
/* /*
* Missing or empty ranges property ("ranges;") for the * Missing or empty ranges property ("ranges;") for the
* 'fsl,qoriq-mc' node. In this case, identity mapping * 'fsl,qoriq-mc' node. In this case, identity mapping
......
...@@ -255,7 +255,7 @@ srpc_service_init(struct srpc_service *svc) ...@@ -255,7 +255,7 @@ srpc_service_init(struct srpc_service *svc)
svc->sv_shuttingdown = 0; svc->sv_shuttingdown = 0;
svc->sv_cpt_data = cfs_percpt_alloc(lnet_cpt_table(), svc->sv_cpt_data = cfs_percpt_alloc(lnet_cpt_table(),
sizeof(*svc->sv_cpt_data)); sizeof(**svc->sv_cpt_data));
if (!svc->sv_cpt_data) if (!svc->sv_cpt_data)
return -ENOMEM; return -ENOMEM;
......
...@@ -397,8 +397,10 @@ buffer_from_host(struct vchiq_mmal_instance *instance, ...@@ -397,8 +397,10 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
/* get context */ /* get context */
msg_context = get_msg_context(instance); msg_context = get_msg_context(instance);
if (msg_context == NULL) if (!msg_context) {
return -ENOMEM; ret = -ENOMEM;
goto unlock;
}
/* store bulk message context for when data arrives */ /* store bulk message context for when data arrives */
msg_context->u.bulk.instance = instance; msg_context->u.bulk.instance = instance;
...@@ -454,6 +456,7 @@ buffer_from_host(struct vchiq_mmal_instance *instance, ...@@ -454,6 +456,7 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
vchi_service_release(instance->handle); vchi_service_release(instance->handle);
unlock:
mutex_unlock(&instance->bulk_mutex); mutex_unlock(&instance->bulk_mutex);
return ret; return ret;
......
...@@ -121,8 +121,14 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) ...@@ -121,8 +121,14 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
if (err < 0) if (err < 0)
return err; return err;
(void)of_property_read_u32(dev->of_node, "cache-line-size", err = of_property_read_u32(dev->of_node, "cache-line-size",
&g_cache_line_size); &g_cache_line_size);
if (err) {
dev_err(dev, "Missing cache-line-size property\n");
return -ENODEV;
}
g_fragments_size = 2 * g_cache_line_size; g_fragments_size = 2 * g_cache_line_size;
/* Allocate space for the channels in coherent memory */ /* Allocate space for the channels in coherent memory */
......
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