Skip to content

Commit 91aff98

Browse files
committed
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
2 parents 33a8b3e + a45e47f commit 91aff98

File tree

8 files changed

+29
-23
lines changed

8 files changed

+29
-23
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5034,7 +5034,6 @@ F: lib/fault-inject.c
50345034

50355035
FBTFT Framebuffer drivers
50365036
M: Thomas Petazzoni <[email protected]>
5037-
M: Noralf Trønnes <[email protected]>
50385037
S: Maintained
50395038
F: drivers/staging/fbtft/
50405039

drivers/iio/adc/rcar-gyroadc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
336336
struct device_node *child;
337337
struct regulator *vref;
338338
unsigned int reg;
339-
unsigned int adcmode, childmode;
339+
unsigned int adcmode = -1, childmode;
340340
unsigned int sample_width;
341341
unsigned int num_channels;
342342
int ret, first = 1;
@@ -366,6 +366,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
366366
channels = rcar_gyroadc_iio_channels_3;
367367
num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3);
368368
break;
369+
default:
370+
return -EINVAL;
369371
}
370372

371373
/*

drivers/iio/adc/xilinx-xadc-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)
12081208

12091209
ret = xadc->ops->setup(pdev, indio_dev, irq);
12101210
if (ret)
1211-
goto err_free_samplerate_trigger;
1211+
goto err_clk_disable_unprepare;
12121212

12131213
ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
12141214
dev_name(&pdev->dev), indio_dev);
@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
12681268

12691269
err_free_irq:
12701270
free_irq(irq, indio_dev);
1271+
err_clk_disable_unprepare:
1272+
clk_disable_unprepare(xadc->clk);
12711273
err_free_samplerate_trigger:
12721274
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
12731275
iio_trigger_free(xadc->samplerate_trigger);
@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
12771279
err_triggered_buffer_cleanup:
12781280
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
12791281
iio_triggered_buffer_cleanup(indio_dev);
1280-
err_clk_disable_unprepare:
1281-
clk_disable_unprepare(xadc->clk);
12821282
err_device_free:
12831283
kfree(indio_dev->channels);
12841284

drivers/iio/counter/104-quad-8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
7676
return IIO_VAL_INT;
7777
}
7878

79-
flags = inb(base_offset);
79+
flags = inb(base_offset + 1);
8080
borrow = flags & BIT(0);
8181
carry = !!(flags & BIT(1));
8282

drivers/staging/fsl-mc/bus/fsl-mc-bus.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,7 @@ static int parse_mc_ranges(struct device *dev,
588588
int *paddr_cells,
589589
int *mc_addr_cells,
590590
int *mc_size_cells,
591-
const __be32 **ranges_start,
592-
u8 *num_ranges)
591+
const __be32 **ranges_start)
593592
{
594593
const __be32 *prop;
595594
int range_tuple_cell_count;
@@ -602,8 +601,6 @@ static int parse_mc_ranges(struct device *dev,
602601
dev_warn(dev,
603602
"missing or empty ranges property for device tree node '%s'\n",
604603
mc_node->name);
605-
606-
*num_ranges = 0;
607604
return 0;
608605
}
609606

@@ -630,33 +627,32 @@ static int parse_mc_ranges(struct device *dev,
630627
return -EINVAL;
631628
}
632629

633-
*num_ranges = ranges_len / tuple_len;
634-
return 0;
630+
return ranges_len / tuple_len;
635631
}
636632

637633
static int get_mc_addr_translation_ranges(struct device *dev,
638634
struct fsl_mc_addr_translation_range
639635
**ranges,
640636
u8 *num_ranges)
641637
{
642-
int error;
638+
int ret;
643639
int paddr_cells;
644640
int mc_addr_cells;
645641
int mc_size_cells;
646642
int i;
647643
const __be32 *ranges_start;
648644
const __be32 *cell;
649645

650-
error = parse_mc_ranges(dev,
646+
ret = parse_mc_ranges(dev,
651647
&paddr_cells,
652648
&mc_addr_cells,
653649
&mc_size_cells,
654-
&ranges_start,
655-
num_ranges);
656-
if (error < 0)
657-
return error;
650+
&ranges_start);
651+
if (ret < 0)
652+
return ret;
658653

659-
if (!(*num_ranges)) {
654+
*num_ranges = ret;
655+
if (!ret) {
660656
/*
661657
* Missing or empty ranges property ("ranges;") for the
662658
* 'fsl,qoriq-mc' node. In this case, identity mapping

drivers/staging/lustre/lnet/selftest/rpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ srpc_service_init(struct srpc_service *svc)
255255
svc->sv_shuttingdown = 0;
256256

257257
svc->sv_cpt_data = cfs_percpt_alloc(lnet_cpt_table(),
258-
sizeof(*svc->sv_cpt_data));
258+
sizeof(**svc->sv_cpt_data));
259259
if (!svc->sv_cpt_data)
260260
return -ENOMEM;
261261

drivers/staging/media/platform/bcm2835/mmal-vchiq.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,10 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
397397

398398
/* get context */
399399
msg_context = get_msg_context(instance);
400-
if (msg_context == NULL)
401-
return -ENOMEM;
400+
if (!msg_context) {
401+
ret = -ENOMEM;
402+
goto unlock;
403+
}
402404

403405
/* store bulk message context for when data arrives */
404406
msg_context->u.bulk.instance = instance;
@@ -454,6 +456,7 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
454456

455457
vchi_service_release(instance->handle);
456458

459+
unlock:
457460
mutex_unlock(&instance->bulk_mutex);
458461

459462
return ret;

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
121121
if (err < 0)
122122
return err;
123123

124-
(void)of_property_read_u32(dev->of_node, "cache-line-size",
124+
err = of_property_read_u32(dev->of_node, "cache-line-size",
125125
&g_cache_line_size);
126+
127+
if (err) {
128+
dev_err(dev, "Missing cache-line-size property\n");
129+
return -ENODEV;
130+
}
131+
126132
g_fragments_size = 2 * g_cache_line_size;
127133

128134
/* Allocate space for the channels in coherent memory */

0 commit comments

Comments
 (0)