aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-23 06:37:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-23 06:37:16 -0400
commitdd9d064e34a1b1c96d631cca73e2a6efc5834f4a (patch)
tree8e3aed218c842178688f31659a952d95145efb4b
parent17e7637f5947284cd7f41c1b26ff8cbee9a794a4 (diff)
parentc97d96b4e612c7dc1b37d7afc61b598a9a25994d (diff)
Merge tag 'staging-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO fixes from Greg KH: "Here are a small number of patches to resolve some reported IIO and a staging driver problem. Nothing major here, full details are in the shortlog below. All have been in linux-next with no reported issues" * tag 'staging-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: bcm2835-audio: Fix memory corruption iio: adc: at91-sama5d2_adc: fix probe error on missing trigger property iio: adc: dln2-adc: fix build error iio: dummy: events: Add missing break staging: iio: ade7759: fix signed extension bug on shift of a u8 iio: pressure: zpa2326: Remove always-true check which confuses gcc iio: proximity: as3935: noise detection + threshold changes
-rw-r--r--Documentation/ABI/testing/sysfs-bus-iio-proximity-as39358
-rw-r--r--Documentation/devicetree/bindings/iio/proximity/as3935.txt5
-rw-r--r--drivers/iio/adc/Kconfig2
-rw-r--r--drivers/iio/adc/at91-sama5d2_adc.c45
-rw-r--r--drivers/iio/dummy/iio_simple_dummy_events.c1
-rw-r--r--drivers/iio/pressure/zpa2326.c10
-rw-r--r--drivers/iio/proximity/as3935.c43
-rw-r--r--drivers/staging/iio/meter/ade7759.c2
-rw-r--r--drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c19
9 files changed, 96 insertions, 39 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 b/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935
index 33e96f740639..147d4e8a1403 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935
+++ b/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935
@@ -14,3 +14,11 @@ Description:
14 Show or set the gain boost of the amp, from 0-31 range. 14 Show or set the gain boost of the amp, from 0-31 range.
15 18 = indoors (default) 15 18 = indoors (default)
16 14 = outdoors 16 14 = outdoors
17
18What /sys/bus/iio/devices/iio:deviceX/noise_level_tripped
19Date: May 2017
20KernelVersion: 4.13
21Contact: Matt Ranostay <matt.ranostay@konsulko.com>
22Description:
23 When 1 the noise level is over the trip level and not reporting
24 valid data
diff --git a/Documentation/devicetree/bindings/iio/proximity/as3935.txt b/Documentation/devicetree/bindings/iio/proximity/as3935.txt
index 38d74314b7ab..b6c1afa6f02d 100644
--- a/Documentation/devicetree/bindings/iio/proximity/as3935.txt
+++ b/Documentation/devicetree/bindings/iio/proximity/as3935.txt
@@ -16,6 +16,10 @@ Optional properties:
16 - ams,tuning-capacitor-pf: Calibration tuning capacitor stepping 16 - ams,tuning-capacitor-pf: Calibration tuning capacitor stepping
17 value 0 - 120pF. This will require using the calibration data from 17 value 0 - 120pF. This will require using the calibration data from
18 the manufacturer. 18 the manufacturer.
19 - ams,nflwdth: Set the noise and watchdog threshold register on
20 startup. This will need to set according to the noise from the
21 MCU board, and possibly the local environment. Refer to the
22 datasheet for the threshold settings.
19 23
20Example: 24Example:
21 25
@@ -27,4 +31,5 @@ as3935@0 {
27 interrupt-parent = <&gpio1>; 31 interrupt-parent = <&gpio1>;
28 interrupts = <16 1>; 32 interrupts = <16 1>;
29 ams,tuning-capacitor-pf = <80>; 33 ams,tuning-capacitor-pf = <80>;
34 ams,nflwdth = <0x44>;
30}; 35};
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 57625653fcb6..1d13bf03c758 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -243,6 +243,8 @@ config DA9150_GPADC
243config DLN2_ADC 243config DLN2_ADC
244 tristate "Diolan DLN-2 ADC driver support" 244 tristate "Diolan DLN-2 ADC driver support"
245 depends on MFD_DLN2 245 depends on MFD_DLN2
246 select IIO_BUFFER
247 select IIO_TRIGGERED_BUFFER
246 help 248 help
247 Say yes here to build support for Diolan DLN-2 ADC. 249 Say yes here to build support for Diolan DLN-2 ADC.
248 250
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index bc5b38e3a147..a70ef7fec95f 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -225,6 +225,7 @@ struct at91_adc_trigger {
225 char *name; 225 char *name;
226 unsigned int trgmod_value; 226 unsigned int trgmod_value;
227 unsigned int edge_type; 227 unsigned int edge_type;
228 bool hw_trig;
228}; 229};
229 230
230struct at91_adc_state { 231struct at91_adc_state {
@@ -254,16 +255,25 @@ static const struct at91_adc_trigger at91_adc_trigger_list[] = {
254 .name = "external_rising", 255 .name = "external_rising",
255 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_RISE, 256 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_RISE,
256 .edge_type = IRQ_TYPE_EDGE_RISING, 257 .edge_type = IRQ_TYPE_EDGE_RISING,
258 .hw_trig = true,
257 }, 259 },
258 { 260 {
259 .name = "external_falling", 261 .name = "external_falling",
260 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_FALL, 262 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_FALL,
261 .edge_type = IRQ_TYPE_EDGE_FALLING, 263 .edge_type = IRQ_TYPE_EDGE_FALLING,
264 .hw_trig = true,
262 }, 265 },
263 { 266 {
264 .name = "external_any", 267 .name = "external_any",
265 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_ANY, 268 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_EXT_TRIG_ANY,
266 .edge_type = IRQ_TYPE_EDGE_BOTH, 269 .edge_type = IRQ_TYPE_EDGE_BOTH,
270 .hw_trig = true,
271 },
272 {
273 .name = "software",
274 .trgmod_value = AT91_SAMA5D2_TRGR_TRGMOD_NO_TRIGGER,
275 .edge_type = IRQ_TYPE_NONE,
276 .hw_trig = false,
267 }, 277 },
268}; 278};
269 279
@@ -597,7 +607,7 @@ static int at91_adc_probe(struct platform_device *pdev)
597 struct at91_adc_state *st; 607 struct at91_adc_state *st;
598 struct resource *res; 608 struct resource *res;
599 int ret, i; 609 int ret, i;
600 u32 edge_type; 610 u32 edge_type = IRQ_TYPE_NONE;
601 611
602 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); 612 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*st));
603 if (!indio_dev) 613 if (!indio_dev)
@@ -641,14 +651,14 @@ static int at91_adc_probe(struct platform_device *pdev)
641 ret = of_property_read_u32(pdev->dev.of_node, 651 ret = of_property_read_u32(pdev->dev.of_node,
642 "atmel,trigger-edge-type", &edge_type); 652 "atmel,trigger-edge-type", &edge_type);
643 if (ret) { 653 if (ret) {
644 dev_err(&pdev->dev, 654 dev_dbg(&pdev->dev,
645 "invalid or missing value for atmel,trigger-edge-type\n"); 655 "atmel,trigger-edge-type not specified, only software trigger available\n");
646 return ret;
647 } 656 }
648 657
649 st->selected_trig = NULL; 658 st->selected_trig = NULL;
650 659
651 for (i = 0; i < AT91_SAMA5D2_HW_TRIG_CNT; i++) 660 /* find the right trigger, or no trigger at all */
661 for (i = 0; i < AT91_SAMA5D2_HW_TRIG_CNT + 1; i++)
652 if (at91_adc_trigger_list[i].edge_type == edge_type) { 662 if (at91_adc_trigger_list[i].edge_type == edge_type) {
653 st->selected_trig = &at91_adc_trigger_list[i]; 663 st->selected_trig = &at91_adc_trigger_list[i];
654 break; 664 break;
@@ -717,24 +727,27 @@ static int at91_adc_probe(struct platform_device *pdev)
717 727
718 platform_set_drvdata(pdev, indio_dev); 728 platform_set_drvdata(pdev, indio_dev);
719 729
720 ret = at91_adc_buffer_init(indio_dev); 730 if (st->selected_trig->hw_trig) {
721 if (ret < 0) { 731 ret = at91_adc_buffer_init(indio_dev);
722 dev_err(&pdev->dev, "couldn't initialize the buffer.\n"); 732 if (ret < 0) {
723 goto per_clk_disable_unprepare; 733 dev_err(&pdev->dev, "couldn't initialize the buffer.\n");
724 } 734 goto per_clk_disable_unprepare;
735 }
725 736
726 ret = at91_adc_trigger_init(indio_dev); 737 ret = at91_adc_trigger_init(indio_dev);
727 if (ret < 0) { 738 if (ret < 0) {
728 dev_err(&pdev->dev, "couldn't setup the triggers.\n"); 739 dev_err(&pdev->dev, "couldn't setup the triggers.\n");
729 goto per_clk_disable_unprepare; 740 goto per_clk_disable_unprepare;
741 }
730 } 742 }
731 743
732 ret = iio_device_register(indio_dev); 744 ret = iio_device_register(indio_dev);
733 if (ret < 0) 745 if (ret < 0)
734 goto per_clk_disable_unprepare; 746 goto per_clk_disable_unprepare;
735 747
736 dev_info(&pdev->dev, "setting up trigger as %s\n", 748 if (st->selected_trig->hw_trig)
737 st->selected_trig->name); 749 dev_info(&pdev->dev, "setting up trigger as %s\n",
750 st->selected_trig->name);
738 751
739 dev_info(&pdev->dev, "version: %x\n", 752 dev_info(&pdev->dev, "version: %x\n",
740 readl_relaxed(st->base + AT91_SAMA5D2_VERSION)); 753 readl_relaxed(st->base + AT91_SAMA5D2_VERSION));
diff --git a/drivers/iio/dummy/iio_simple_dummy_events.c b/drivers/iio/dummy/iio_simple_dummy_events.c
index ed63ffd849f8..7ec2a0bb0807 100644
--- a/drivers/iio/dummy/iio_simple_dummy_events.c
+++ b/drivers/iio/dummy/iio_simple_dummy_events.c
@@ -72,6 +72,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
72 st->event_en = state; 72 st->event_en = state;
73 else 73 else
74 return -EINVAL; 74 return -EINVAL;
75 break;
75 default: 76 default:
76 return -EINVAL; 77 return -EINVAL;
77 } 78 }
diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
index ebfb1de7377f..91431454eb85 100644
--- a/drivers/iio/pressure/zpa2326.c
+++ b/drivers/iio/pressure/zpa2326.c
@@ -865,7 +865,6 @@ complete:
865static int zpa2326_wait_oneshot_completion(const struct iio_dev *indio_dev, 865static int zpa2326_wait_oneshot_completion(const struct iio_dev *indio_dev,
866 struct zpa2326_private *private) 866 struct zpa2326_private *private)
867{ 867{
868 int ret;
869 unsigned int val; 868 unsigned int val;
870 long timeout; 869 long timeout;
871 870
@@ -887,14 +886,11 @@ static int zpa2326_wait_oneshot_completion(const struct iio_dev *indio_dev,
887 /* Timed out. */ 886 /* Timed out. */
888 zpa2326_warn(indio_dev, "no one shot interrupt occurred (%ld)", 887 zpa2326_warn(indio_dev, "no one shot interrupt occurred (%ld)",
889 timeout); 888 timeout);
890 ret = -ETIME; 889 return -ETIME;
891 } else if (timeout < 0) {
892 zpa2326_warn(indio_dev,
893 "wait for one shot interrupt cancelled");
894 ret = -ERESTARTSYS;
895 } 890 }
896 891
897 return ret; 892 zpa2326_warn(indio_dev, "wait for one shot interrupt cancelled");
893 return -ERESTARTSYS;
898} 894}
899 895
900static int zpa2326_init_managed_irq(struct device *parent, 896static int zpa2326_init_managed_irq(struct device *parent,
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
index 0eeff29b61be..4a48b7ba3a1c 100644
--- a/drivers/iio/proximity/as3935.c
+++ b/drivers/iio/proximity/as3935.c
@@ -39,8 +39,12 @@
39#define AS3935_AFE_GAIN_MAX 0x1F 39#define AS3935_AFE_GAIN_MAX 0x1F
40#define AS3935_AFE_PWR_BIT BIT(0) 40#define AS3935_AFE_PWR_BIT BIT(0)
41 41
42#define AS3935_NFLWDTH 0x01
43#define AS3935_NFLWDTH_MASK 0x7f
44
42#define AS3935_INT 0x03 45#define AS3935_INT 0x03
43#define AS3935_INT_MASK 0x0f 46#define AS3935_INT_MASK 0x0f
47#define AS3935_DISTURB_INT BIT(2)
44#define AS3935_EVENT_INT BIT(3) 48#define AS3935_EVENT_INT BIT(3)
45#define AS3935_NOISE_INT BIT(0) 49#define AS3935_NOISE_INT BIT(0)
46 50
@@ -48,6 +52,7 @@
48#define AS3935_DATA_MASK 0x3F 52#define AS3935_DATA_MASK 0x3F
49 53
50#define AS3935_TUNE_CAP 0x08 54#define AS3935_TUNE_CAP 0x08
55#define AS3935_DEFAULTS 0x3C
51#define AS3935_CALIBRATE 0x3D 56#define AS3935_CALIBRATE 0x3D
52 57
53#define AS3935_READ_DATA BIT(14) 58#define AS3935_READ_DATA BIT(14)
@@ -62,7 +67,9 @@ struct as3935_state {
62 struct mutex lock; 67 struct mutex lock;
63 struct delayed_work work; 68 struct delayed_work work;
64 69
70 unsigned long noise_tripped;
65 u32 tune_cap; 71 u32 tune_cap;
72 u32 nflwdth_reg;
66 u8 buffer[16]; /* 8-bit data + 56-bit padding + 64-bit timestamp */ 73 u8 buffer[16]; /* 8-bit data + 56-bit padding + 64-bit timestamp */
67 u8 buf[2] ____cacheline_aligned; 74 u8 buf[2] ____cacheline_aligned;
68}; 75};
@@ -145,12 +152,29 @@ static ssize_t as3935_sensor_sensitivity_store(struct device *dev,
145 return len; 152 return len;
146} 153}
147 154
155static ssize_t as3935_noise_level_tripped_show(struct device *dev,
156 struct device_attribute *attr,
157 char *buf)
158{
159 struct as3935_state *st = iio_priv(dev_to_iio_dev(dev));
160 int ret;
161
162 mutex_lock(&st->lock);
163 ret = sprintf(buf, "%d\n", !time_after(jiffies, st->noise_tripped + HZ));
164 mutex_unlock(&st->lock);
165
166 return ret;
167}
168
148static IIO_DEVICE_ATTR(sensor_sensitivity, S_IRUGO | S_IWUSR, 169static IIO_DEVICE_ATTR(sensor_sensitivity, S_IRUGO | S_IWUSR,
149 as3935_sensor_sensitivity_show, as3935_sensor_sensitivity_store, 0); 170 as3935_sensor_sensitivity_show, as3935_sensor_sensitivity_store, 0);
150 171
172static IIO_DEVICE_ATTR(noise_level_tripped, S_IRUGO,
173 as3935_noise_level_tripped_show, NULL, 0);
151 174
152static struct attribute *as3935_attributes[] = { 175static struct attribute *as3935_attributes[] = {
153 &iio_dev_attr_sensor_sensitivity.dev_attr.attr, 176 &iio_dev_attr_sensor_sensitivity.dev_attr.attr,
177 &iio_dev_attr_noise_level_tripped.dev_attr.attr,
154 NULL, 178 NULL,
155}; 179};
156 180
@@ -246,7 +270,11 @@ static void as3935_event_work(struct work_struct *work)
246 case AS3935_EVENT_INT: 270 case AS3935_EVENT_INT:
247 iio_trigger_poll_chained(st->trig); 271 iio_trigger_poll_chained(st->trig);
248 break; 272 break;
273 case AS3935_DISTURB_INT:
249 case AS3935_NOISE_INT: 274 case AS3935_NOISE_INT:
275 mutex_lock(&st->lock);
276 st->noise_tripped = jiffies;
277 mutex_unlock(&st->lock);
250 dev_warn(&st->spi->dev, "noise level is too high\n"); 278 dev_warn(&st->spi->dev, "noise level is too high\n");
251 break; 279 break;
252 } 280 }
@@ -269,15 +297,14 @@ static irqreturn_t as3935_interrupt_handler(int irq, void *private)
269 297
270static void calibrate_as3935(struct as3935_state *st) 298static void calibrate_as3935(struct as3935_state *st)
271{ 299{
272 /* mask disturber interrupt bit */ 300 as3935_write(st, AS3935_DEFAULTS, 0x96);
273 as3935_write(st, AS3935_INT, BIT(5));
274
275 as3935_write(st, AS3935_CALIBRATE, 0x96); 301 as3935_write(st, AS3935_CALIBRATE, 0x96);
276 as3935_write(st, AS3935_TUNE_CAP, 302 as3935_write(st, AS3935_TUNE_CAP,
277 BIT(5) | (st->tune_cap / TUNE_CAP_DIV)); 303 BIT(5) | (st->tune_cap / TUNE_CAP_DIV));
278 304
279 mdelay(2); 305 mdelay(2);
280 as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV)); 306 as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV));
307 as3935_write(st, AS3935_NFLWDTH, st->nflwdth_reg);
281} 308}
282 309
283#ifdef CONFIG_PM_SLEEP 310#ifdef CONFIG_PM_SLEEP
@@ -370,6 +397,15 @@ static int as3935_probe(struct spi_device *spi)
370 return -EINVAL; 397 return -EINVAL;
371 } 398 }
372 399
400 ret = of_property_read_u32(np,
401 "ams,nflwdth", &st->nflwdth_reg);
402 if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
403 dev_err(&spi->dev,
404 "invalid nflwdth setting of %d\n",
405 st->nflwdth_reg);
406 return -EINVAL;
407 }
408
373 indio_dev->dev.parent = &spi->dev; 409 indio_dev->dev.parent = &spi->dev;
374 indio_dev->name = spi_get_device_id(spi)->name; 410 indio_dev->name = spi_get_device_id(spi)->name;
375 indio_dev->channels = as3935_channels; 411 indio_dev->channels = as3935_channels;
@@ -384,6 +420,7 @@ static int as3935_probe(struct spi_device *spi)
384 return -ENOMEM; 420 return -ENOMEM;
385 421
386 st->trig = trig; 422 st->trig = trig;
423 st->noise_tripped = jiffies - HZ;
387 trig->dev.parent = indio_dev->dev.parent; 424 trig->dev.parent = indio_dev->dev.parent;
388 iio_trigger_set_drvdata(trig, indio_dev); 425 iio_trigger_set_drvdata(trig, indio_dev);
389 trig->ops = &iio_interrupt_trigger_ops; 426 trig->ops = &iio_interrupt_trigger_ops;
diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 1691760339da..02573c517d9d 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -172,7 +172,7 @@ static int ade7759_spi_read_reg_40(struct device *dev,
172 reg_address); 172 reg_address);
173 goto error_ret; 173 goto error_ret;
174 } 174 }
175 *val = ((u64)st->rx[1] << 32) | (st->rx[2] << 24) | 175 *val = ((u64)st->rx[1] << 32) | ((u64)st->rx[2] << 24) |
176 (st->rx[3] << 16) | (st->rx[4] << 8) | st->rx[5]; 176 (st->rx[3] << 16) | (st->rx[4] << 8) | st->rx[5];
177 177
178error_ret: 178error_ret:
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 5f3d8f2339e3..4be864dbd41c 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -390,8 +390,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
390 __func__, instance); 390 __func__, instance);
391 instance->alsa_stream = alsa_stream; 391 instance->alsa_stream = alsa_stream;
392 alsa_stream->instance = instance; 392 alsa_stream->instance = instance;
393 ret = 0; // xxx todo -1; 393 return 0;
394 goto err_free_mem;
395 } 394 }
396 395
397 /* Initialize and create a VCHI connection */ 396 /* Initialize and create a VCHI connection */
@@ -401,16 +400,15 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
401 LOG_ERR("%s: failed to initialise VCHI instance (ret=%d)\n", 400 LOG_ERR("%s: failed to initialise VCHI instance (ret=%d)\n",
402 __func__, ret); 401 __func__, ret);
403 402
404 ret = -EIO; 403 return -EIO;
405 goto err_free_mem;
406 } 404 }
407 ret = vchi_connect(NULL, 0, vchi_instance); 405 ret = vchi_connect(NULL, 0, vchi_instance);
408 if (ret) { 406 if (ret) {
409 LOG_ERR("%s: failed to connect VCHI instance (ret=%d)\n", 407 LOG_ERR("%s: failed to connect VCHI instance (ret=%d)\n",
410 __func__, ret); 408 __func__, ret);
411 409
412 ret = -EIO; 410 kfree(vchi_instance);
413 goto err_free_mem; 411 return -EIO;
414 } 412 }
415 initted = 1; 413 initted = 1;
416 } 414 }
@@ -421,19 +419,16 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
421 if (IS_ERR(instance)) { 419 if (IS_ERR(instance)) {
422 LOG_ERR("%s: failed to initialize audio service\n", __func__); 420 LOG_ERR("%s: failed to initialize audio service\n", __func__);
423 421
424 ret = PTR_ERR(instance); 422 /* vchi_instance is retained for use the next time. */
425 goto err_free_mem; 423 return PTR_ERR(instance);
426 } 424 }
427 425
428 instance->alsa_stream = alsa_stream; 426 instance->alsa_stream = alsa_stream;
429 alsa_stream->instance = instance; 427 alsa_stream->instance = instance;
430 428
431 LOG_DBG(" success !\n"); 429 LOG_DBG(" success !\n");
432 ret = 0;
433err_free_mem:
434 kfree(vchi_instance);
435 430
436 return ret; 431 return 0;
437} 432}
438 433
439int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream) 434int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream)