Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Simplify code with cleanup.h

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Allocate the memory with scoped/cleanup.h to reduce error handling
(simpler error paths) and make the code a bit smaller.

+87 -141
+29 -54
sound/soc/codecs/audio-iio-aux.c
··· 6 6 // 7 7 // Author: Herve Codina <herve.codina@bootlin.com> 8 8 9 + #include <linux/cleanup.h> 9 10 #include <linux/iio/consumer.h> 10 11 #include <linux/minmax.h> 11 12 #include <linux/mod_devicetable.h> ··· 132 131 struct audio_iio_aux_chan *chan) 133 132 { 134 133 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 135 - char *output_name; 136 - char *input_name; 137 - char *pga_name; 138 134 int ret; 139 135 140 - input_name = kasprintf(GFP_KERNEL, "%s IN", chan->name); 136 + /* Allocated names are not needed afterwards (duplicated in ASoC internals) */ 137 + char *input_name __free(kfree) = kasprintf(GFP_KERNEL, "%s IN", chan->name); 141 138 if (!input_name) 142 139 return -ENOMEM; 143 140 144 - output_name = kasprintf(GFP_KERNEL, "%s OUT", chan->name); 145 - if (!output_name) { 146 - ret = -ENOMEM; 147 - goto out_free_input_name; 148 - } 141 + char *output_name __free(kfree) = kasprintf(GFP_KERNEL, "%s OUT", chan->name); 142 + if (!output_name) 143 + return -ENOMEM; 149 144 150 - pga_name = kasprintf(GFP_KERNEL, "%s PGA", chan->name); 151 - if (!pga_name) { 152 - ret = -ENOMEM; 153 - goto out_free_output_name; 154 - } 145 + char *pga_name __free(kfree) = kasprintf(GFP_KERNEL, "%s PGA", chan->name); 146 + if (!pga_name) 147 + return -ENOMEM; 155 148 156 149 widgets[0] = SND_SOC_DAPM_INPUT(input_name); 157 150 widgets[1] = SND_SOC_DAPM_OUTPUT(output_name); 158 151 widgets[2] = SND_SOC_DAPM_PGA(pga_name, SND_SOC_NOPM, 0, 0, NULL, 0); 159 152 ret = snd_soc_dapm_new_controls(dapm, widgets, 3); 160 153 if (ret) 161 - goto out_free_pga_name; 154 + return ret; 162 155 163 156 routes[0].sink = pga_name; 164 157 routes[0].control = NULL; ··· 160 165 routes[1].sink = output_name; 161 166 routes[1].control = NULL; 162 167 routes[1].source = pga_name; 163 - ret = snd_soc_dapm_add_routes(dapm, routes, 2); 164 168 165 - /* Allocated names are no more needed (duplicated in ASoC internals) */ 166 - 167 - out_free_pga_name: 168 - kfree(pga_name); 169 - out_free_output_name: 170 - kfree(output_name); 171 - out_free_input_name: 172 - kfree(input_name); 173 - return ret; 169 + return snd_soc_dapm_add_routes(dapm, routes, 2); 174 170 } 175 171 176 172 static int audio_iio_aux_component_probe(struct snd_soc_component *component) ··· 230 244 struct audio_iio_aux_chan *iio_aux_chan; 231 245 struct device *dev = &pdev->dev; 232 246 struct audio_iio_aux *iio_aux; 233 - const char **names; 234 - u32 *invert_ranges; 235 247 int count; 236 248 int ret; 237 249 int i; ··· 246 262 247 263 iio_aux->num_chans = count; 248 264 249 - names = kcalloc(iio_aux->num_chans, sizeof(*names), GFP_KERNEL); 265 + const char **names __free(kfree) = kcalloc(iio_aux->num_chans, 266 + sizeof(*names), 267 + GFP_KERNEL); 250 268 if (!names) 251 269 return -ENOMEM; 252 270 253 - invert_ranges = kcalloc(iio_aux->num_chans, sizeof(*invert_ranges), GFP_KERNEL); 254 - if (!invert_ranges) { 255 - ret = -ENOMEM; 256 - goto out_free_names; 257 - } 271 + u32 *invert_ranges __free(kfree) = kcalloc(iio_aux->num_chans, 272 + sizeof(*invert_ranges), 273 + GFP_KERNEL); 274 + if (!invert_ranges) 275 + return -ENOMEM; 258 276 259 277 ret = device_property_read_string_array(dev, "io-channel-names", 260 278 names, iio_aux->num_chans); 261 - if (ret < 0) { 262 - dev_err_probe(dev, ret, "failed to read io-channel-names\n"); 263 - goto out_free_invert_ranges; 264 - } 279 + if (ret < 0) 280 + return dev_err_probe(dev, ret, "failed to read io-channel-names\n"); 265 281 266 282 /* 267 283 * snd-control-invert-range is optional and can contain fewer items ··· 272 288 count = min_t(unsigned int, count, iio_aux->num_chans); 273 289 ret = device_property_read_u32_array(dev, "snd-control-invert-range", 274 290 invert_ranges, count); 275 - if (ret < 0) { 276 - dev_err_probe(dev, ret, "failed to read snd-control-invert-range\n"); 277 - goto out_free_invert_ranges; 278 - } 291 + if (ret < 0) 292 + return dev_err_probe(dev, ret, "failed to read snd-control-invert-range\n"); 279 293 } 280 294 281 295 for (i = 0; i < iio_aux->num_chans; i++) { ··· 282 300 iio_aux_chan->is_invert_range = invert_ranges[i]; 283 301 284 302 iio_aux_chan->iio_chan = devm_iio_channel_get(dev, iio_aux_chan->name); 285 - if (IS_ERR(iio_aux_chan->iio_chan)) { 286 - ret = PTR_ERR(iio_aux_chan->iio_chan); 287 - dev_err_probe(dev, ret, "get IIO channel '%s' failed\n", 288 - iio_aux_chan->name); 289 - goto out_free_invert_ranges; 290 - } 303 + if (IS_ERR(iio_aux_chan->iio_chan)) 304 + return dev_err_probe(dev, PTR_ERR(iio_aux_chan->iio_chan), 305 + "get IIO channel '%s' failed\n", 306 + iio_aux_chan->name); 291 307 } 292 308 293 309 platform_set_drvdata(pdev, iio_aux); 294 310 295 - ret = devm_snd_soc_register_component(dev, &audio_iio_aux_component_driver, 296 - NULL, 0); 297 - out_free_invert_ranges: 298 - kfree(invert_ranges); 299 - out_free_names: 300 - kfree(names); 301 - return ret; 311 + return devm_snd_soc_register_component(dev, &audio_iio_aux_component_driver, 312 + NULL, 0); 302 313 } 303 314 304 315 static const struct of_device_id audio_iio_aux_ids[] = {
+9 -13
sound/soc/codecs/wcd9335.c
··· 5 5 #include <linux/module.h> 6 6 #include <linux/init.h> 7 7 #include <linux/platform_device.h> 8 + #include <linux/cleanup.h> 8 9 #include <linux/device.h> 9 10 #include <linux/wait.h> 10 11 #include <linux/bitops.h> ··· 2715 2714 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); 2716 2715 unsigned int decimator; 2717 2716 char *dec_adc_mux_name = NULL; 2718 - char *widget_name = NULL; 2719 - char *wname; 2717 + char *widget_name; 2720 2718 int ret = 0, amic_n; 2721 2719 u16 tx_vol_ctl_reg, pwr_level_reg = 0, dec_cfg_reg, hpf_gate_reg; 2722 2720 u16 tx_gain_ctl_reg; 2723 2721 char *dec; 2724 2722 u8 hpf_coff_freq; 2725 2723 2726 - widget_name = kmemdup_nul(w->name, 15, GFP_KERNEL); 2727 - if (!widget_name) 2724 + char *wname __free(kfree) = kmemdup_nul(w->name, 15, GFP_KERNEL); 2725 + if (!wname) 2728 2726 return -ENOMEM; 2729 2727 2730 - wname = widget_name; 2728 + widget_name = wname; 2731 2729 dec_adc_mux_name = strsep(&widget_name, " "); 2732 2730 if (!dec_adc_mux_name) { 2733 2731 dev_err(comp->dev, "%s: Invalid decimator = %s\n", 2734 2732 __func__, w->name); 2735 - ret = -EINVAL; 2736 - goto out; 2733 + return -EINVAL; 2737 2734 } 2738 2735 dec_adc_mux_name = widget_name; 2739 2736 ··· 2739 2740 if (!dec) { 2740 2741 dev_err(comp->dev, "%s: decimator index not found\n", 2741 2742 __func__); 2742 - ret = -EINVAL; 2743 - goto out; 2743 + return -EINVAL; 2744 2744 } 2745 2745 2746 2746 ret = kstrtouint(dec, 10, &decimator); 2747 2747 if (ret < 0) { 2748 2748 dev_err(comp->dev, "%s: Invalid decimator = %s\n", 2749 2749 __func__, wname); 2750 - ret = -EINVAL; 2751 - goto out; 2750 + return -EINVAL; 2752 2751 } 2753 2752 2754 2753 tx_vol_ctl_reg = WCD9335_CDC_TX0_TX_PATH_CTL + 16 * decimator; ··· 2833 2836 snd_soc_component_update_bits(comp, tx_vol_ctl_reg, 0x10, 0x00); 2834 2837 break; 2835 2838 } 2836 - out: 2837 - kfree(wname); 2839 + 2838 2840 return ret; 2839 2841 } 2840 2842
+9 -13
sound/soc/codecs/wcd934x.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 // Copyright (c) 2019, Linaro Limited 3 3 4 + #include <linux/cleanup.h> 4 5 #include <linux/clk.h> 5 6 #include <linux/clk-provider.h> 6 7 #include <linux/interrupt.h> ··· 4974 4973 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); 4975 4974 unsigned int decimator; 4976 4975 char *dec_adc_mux_name = NULL; 4977 - char *widget_name = NULL; 4978 - char *wname; 4976 + char *widget_name; 4979 4977 int ret = 0, amic_n; 4980 4978 u16 tx_vol_ctl_reg, pwr_level_reg = 0, dec_cfg_reg, hpf_gate_reg; 4981 4979 u16 tx_gain_ctl_reg; 4982 4980 char *dec; 4983 4981 u8 hpf_coff_freq; 4984 4982 4985 - widget_name = kstrndup(w->name, 15, GFP_KERNEL); 4986 - if (!widget_name) 4983 + char *wname __free(kfree) = kstrndup(w->name, 15, GFP_KERNEL); 4984 + if (!wname) 4987 4985 return -ENOMEM; 4988 4986 4989 - wname = widget_name; 4987 + widget_name = wname; 4990 4988 dec_adc_mux_name = strsep(&widget_name, " "); 4991 4989 if (!dec_adc_mux_name) { 4992 4990 dev_err(comp->dev, "%s: Invalid decimator = %s\n", 4993 4991 __func__, w->name); 4994 - ret = -EINVAL; 4995 - goto out; 4992 + return -EINVAL; 4996 4993 } 4997 4994 dec_adc_mux_name = widget_name; 4998 4995 ··· 4998 4999 if (!dec) { 4999 5000 dev_err(comp->dev, "%s: decimator index not found\n", 5000 5001 __func__); 5001 - ret = -EINVAL; 5002 - goto out; 5002 + return -EINVAL; 5003 5003 } 5004 5004 5005 5005 ret = kstrtouint(dec, 10, &decimator); 5006 5006 if (ret < 0) { 5007 5007 dev_err(comp->dev, "%s: Invalid decimator = %s\n", 5008 5008 __func__, wname); 5009 - ret = -EINVAL; 5010 - goto out; 5009 + return -EINVAL; 5011 5010 } 5012 5011 5013 5012 tx_vol_ctl_reg = WCD934X_CDC_TX0_TX_PATH_CTL + 16 * decimator; ··· 5098 5101 WCD934X_DEC_PWR_LVL_DF); 5099 5102 break; 5100 5103 } 5101 - out: 5102 - kfree(wname); 5104 + 5103 5105 return ret; 5104 5106 } 5105 5107
+2 -3
sound/soc/generic/audio-graph-card.c
··· 7 7 // 8 8 // based on ${LINUX}/sound/soc/generic/simple-card.c 9 9 10 + #include <linux/cleanup.h> 10 11 #include <linux/clk.h> 11 12 #include <linux/device.h> 12 13 #include <linux/gpio/consumer.h> ··· 574 573 int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev) 575 574 { 576 575 struct snd_soc_card *card = simple_priv_to_card(priv); 577 - struct link_info *li; 578 576 int ret; 579 577 580 - li = devm_kzalloc(dev, sizeof(*li), GFP_KERNEL); 578 + struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); 581 579 if (!li) 582 580 return -ENOMEM; 583 581 ··· 628 628 if (ret < 0) 629 629 goto err; 630 630 631 - devm_kfree(dev, li); 632 631 return 0; 633 632 634 633 err:
+1 -4
sound/soc/generic/audio-graph-card2.c
··· 1350 1350 struct graph2_custom_hooks *hooks) 1351 1351 { 1352 1352 struct snd_soc_card *card = simple_priv_to_card(priv); 1353 - struct link_info *li; 1354 1353 int ret; 1355 1354 1356 - li = devm_kzalloc(dev, sizeof(*li), GFP_KERNEL); 1355 + struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); 1357 1356 if (!li) 1358 1357 return -ENOMEM; 1359 1358 ··· 1416 1417 1417 1418 ret = devm_snd_soc_register_card(dev, card); 1418 1419 err: 1419 - devm_kfree(dev, li); 1420 - 1421 1420 if (ret < 0) 1422 1421 dev_err_probe(dev, ret, "parse error\n"); 1423 1422
+6 -7
sound/soc/generic/simple-card-utils.c
··· 5 5 // Copyright (c) 2016 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 6 6 7 7 #include <dt-bindings/sound/audio-graph.h> 8 + #include <linux/cleanup.h> 8 9 #include <linux/clk.h> 9 10 #include <linux/gpio/consumer.h> 10 11 #include <linux/module.h> ··· 136 135 int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np, 137 136 struct simple_util_dai *dai) 138 137 { 139 - u32 *array_values, *p; 140 138 int n, i, ret; 139 + u32 *p; 141 140 142 141 if (!of_property_read_bool(np, "dai-tdm-slot-width-map")) 143 142 return 0; ··· 152 151 if (!dai->tdm_width_map) 153 152 return -ENOMEM; 154 153 155 - array_values = kcalloc(n, sizeof(*array_values), GFP_KERNEL); 154 + u32 *array_values __free(kfree) = kcalloc(n, sizeof(*array_values), 155 + GFP_KERNEL); 156 156 if (!array_values) 157 157 return -ENOMEM; 158 158 159 159 ret = of_property_read_u32_array(np, "dai-tdm-slot-width-map", array_values, n); 160 160 if (ret < 0) { 161 161 dev_err(dev, "Could not read dai-tdm-slot-width-map: %d\n", ret); 162 - goto out; 162 + return ret; 163 163 } 164 164 165 165 p = array_values; ··· 171 169 } 172 170 173 171 dai->n_tdm_widths = i; 174 - ret = 0; 175 - out: 176 - kfree(array_values); 177 172 178 - return ret; 173 + return 0; 179 174 } 180 175 EXPORT_SYMBOL_GPL(simple_util_parse_tdm_width_map); 181 176
+2 -3
sound/soc/generic/simple-card.c
··· 5 5 // Copyright (C) 2012 Renesas Solutions Corp. 6 6 // Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 7 7 8 + #include <linux/cleanup.h> 8 9 #include <linux/clk.h> 9 10 #include <linux/device.h> 10 11 #include <linux/module.h> ··· 728 727 struct device *dev = &pdev->dev; 729 728 struct device_node *np = dev->of_node; 730 729 struct snd_soc_card *card; 731 - struct link_info *li; 732 730 int ret; 733 731 734 732 /* Allocate the private data and the DAI link array */ ··· 741 741 card->probe = simple_soc_probe; 742 742 card->driver_name = "simple-card"; 743 743 744 - li = devm_kzalloc(dev, sizeof(*li), GFP_KERNEL); 744 + struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); 745 745 if (!li) 746 746 return -ENOMEM; 747 747 ··· 818 818 if (ret < 0) 819 819 goto err; 820 820 821 - devm_kfree(dev, li); 822 821 return 0; 823 822 err: 824 823 simple_util_clean_reference(card);
+19 -28
sound/soc/soc-dapm.c
··· 20 20 #include <linux/module.h> 21 21 #include <linux/init.h> 22 22 #include <linux/async.h> 23 + #include <linux/cleanup.h> 23 24 #include <linux/delay.h> 24 25 #include <linux/pm.h> 25 26 #include <linux/bitops.h> ··· 324 323 const struct snd_soc_dapm_widget *_widget, 325 324 const char *prefix) 326 325 { 327 - struct snd_soc_dapm_widget *w; 328 - 329 - w = kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); 326 + struct snd_soc_dapm_widget *w __free(kfree) = kmemdup(_widget, 327 + sizeof(*_widget), 328 + GFP_KERNEL); 330 329 if (!w) 331 330 return NULL; 332 331 ··· 334 333 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, _widget->name); 335 334 else 336 335 w->name = kstrdup_const(_widget->name, GFP_KERNEL); 337 - if (!w->name) { 338 - kfree(w); 336 + if (!w->name) 339 337 return NULL; 340 - } 341 338 342 339 if (_widget->sname) { 343 340 w->sname = kstrdup_const(_widget->sname, GFP_KERNEL); 344 341 if (!w->sname) { 345 342 kfree_const(w->name); 346 - kfree(w); 347 343 return NULL; 348 344 } 349 345 } 350 - return w; 346 + 347 + return_ptr(w); 351 348 } 352 349 353 350 struct dapm_kcontrol_data { ··· 3882 3883 struct snd_soc_dapm_path *path; 3883 3884 struct snd_soc_dai *source, *sink; 3884 3885 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 3885 - struct snd_pcm_hw_params *params = NULL; 3886 3886 const struct snd_soc_pcm_stream *config = NULL; 3887 3887 struct snd_pcm_runtime *runtime = NULL; 3888 3888 unsigned int fmt; 3889 - int ret = 0; 3889 + int ret; 3890 3890 3891 3891 /* 3892 3892 * NOTE ··· 3896 3898 * stuff that increases stack usage. 3897 3899 * So, we use kzalloc()/kfree() for params in this function. 3898 3900 */ 3899 - params = kzalloc(sizeof(*params), GFP_KERNEL); 3901 + struct snd_pcm_hw_params *params __free(kfree) = kzalloc(sizeof(*params), 3902 + GFP_KERNEL); 3900 3903 if (!params) 3901 3904 return -ENOMEM; 3902 3905 3903 3906 runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); 3904 - if (!runtime) { 3905 - ret = -ENOMEM; 3906 - goto out; 3907 - } 3907 + if (!runtime) 3908 + return -ENOMEM; 3908 3909 3909 3910 substream->runtime = runtime; 3910 3911 ··· 3913 3916 3914 3917 ret = snd_soc_dai_startup(source, substream); 3915 3918 if (ret < 0) 3916 - goto out; 3919 + return ret; 3917 3920 3918 3921 snd_soc_dai_activate(source, substream->stream); 3919 3922 } ··· 3924 3927 3925 3928 ret = snd_soc_dai_startup(sink, substream); 3926 3929 if (ret < 0) 3927 - goto out; 3930 + return ret; 3928 3931 3929 3932 snd_soc_dai_activate(sink, substream->stream); 3930 3933 } ··· 3939 3942 config = rtd->dai_link->c2c_params + rtd->c2c_params_select; 3940 3943 if (!config) { 3941 3944 dev_err(w->dapm->dev, "ASoC: link config missing\n"); 3942 - ret = -EINVAL; 3943 - goto out; 3945 + return -EINVAL; 3944 3946 } 3945 3947 3946 3948 /* Be a little careful as we don't want to overflow the mask array */ 3947 3949 if (!config->formats) { 3948 3950 dev_warn(w->dapm->dev, "ASoC: Invalid format was specified\n"); 3949 3951 3950 - ret = -EINVAL; 3951 - goto out; 3952 + return -EINVAL; 3952 3953 } 3953 3954 3954 3955 fmt = ffs(config->formats) - 1; ··· 3967 3972 3968 3973 ret = snd_soc_dai_hw_params(source, substream, params); 3969 3974 if (ret < 0) 3970 - goto out; 3975 + return ret; 3971 3976 3972 3977 dapm_update_dai_unlocked(substream, params, source); 3973 3978 } ··· 3978 3983 3979 3984 ret = snd_soc_dai_hw_params(sink, substream, params); 3980 3985 if (ret < 0) 3981 - goto out; 3986 + return ret; 3982 3987 3983 3988 dapm_update_dai_unlocked(substream, params, sink); 3984 3989 } ··· 3988 3993 runtime->channels = params_channels(params); 3989 3994 runtime->rate = params_rate(params); 3990 3995 3991 - out: 3992 - /* see above NOTE */ 3993 - kfree(params); 3994 - 3995 - return ret; 3996 + return 0; 3996 3997 } 3997 3998 3998 3999 static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
+10 -16
sound/soc/soc-ops.c
··· 11 11 // with code, comments and ideas from :- 12 12 // Richard Purdie <richard@openedhand.com> 13 13 14 + #include <linux/cleanup.h> 14 15 #include <linux/module.h> 15 16 #include <linux/moduleparam.h> 16 17 #include <linux/init.h> ··· 728 727 struct soc_bytes *params = (void *)kcontrol->private_value; 729 728 int ret, len; 730 729 unsigned int val, mask; 731 - void *data; 732 730 733 731 if (!component->regmap || !params->num_regs) 734 732 return -EINVAL; 735 733 736 734 len = params->num_regs * component->val_bytes; 737 735 738 - data = kmemdup(ucontrol->value.bytes.data, len, GFP_KERNEL | GFP_DMA); 736 + void *data __free(kfree) = kmemdup(ucontrol->value.bytes.data, len, 737 + GFP_KERNEL | GFP_DMA); 739 738 if (!data) 740 739 return -ENOMEM; 741 740 ··· 747 746 if (params->mask) { 748 747 ret = regmap_read(component->regmap, params->base, &val); 749 748 if (ret != 0) 750 - goto out; 749 + return ret; 751 750 752 751 val &= params->mask; 753 752 ··· 761 760 ret = regmap_parse_val(component->regmap, 762 761 &mask, &mask); 763 762 if (ret != 0) 764 - goto out; 763 + return ret; 765 764 766 765 ((u16 *)data)[0] &= mask; 767 766 768 767 ret = regmap_parse_val(component->regmap, 769 768 &val, &val); 770 769 if (ret != 0) 771 - goto out; 770 + return ret; 772 771 773 772 ((u16 *)data)[0] |= val; 774 773 break; ··· 777 776 ret = regmap_parse_val(component->regmap, 778 777 &mask, &mask); 779 778 if (ret != 0) 780 - goto out; 779 + return ret; 781 780 782 781 ((u32 *)data)[0] &= mask; 783 782 784 783 ret = regmap_parse_val(component->regmap, 785 784 &val, &val); 786 785 if (ret != 0) 787 - goto out; 786 + return ret; 788 787 789 788 ((u32 *)data)[0] |= val; 790 789 break; 791 790 default: 792 - ret = -EINVAL; 793 - goto out; 791 + return -EINVAL; 794 792 } 795 793 } 796 794 797 - ret = regmap_raw_write(component->regmap, params->base, 798 - data, len); 799 - 800 - out: 801 - kfree(data); 802 - 803 - return ret; 795 + return regmap_raw_write(component->regmap, params->base, data, len); 804 796 } 805 797 EXPORT_SYMBOL_GPL(snd_soc_bytes_put); 806 798