mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 07:44:21 +08:00
8210f496c3
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. meson_card_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20231013221945.1489203-14-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
55 lines
1.4 KiB
C
55 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (c) 2020 BayLibre, SAS.
|
|
* Author: Jerome Brunet <jbrunet@baylibre.com>
|
|
*/
|
|
|
|
#ifndef _MESON_SND_CARD_H
|
|
#define _MESON_SND_CARD_H
|
|
|
|
struct device_node;
|
|
struct platform_device;
|
|
|
|
struct snd_soc_card;
|
|
struct snd_pcm_substream;
|
|
struct snd_pcm_hw_params;
|
|
|
|
#define DT_PREFIX "amlogic,"
|
|
|
|
struct meson_card_match_data {
|
|
int (*add_link)(struct snd_soc_card *card,
|
|
struct device_node *node,
|
|
int *index);
|
|
};
|
|
|
|
struct meson_card {
|
|
const struct meson_card_match_data *match_data;
|
|
struct snd_soc_card card;
|
|
void **link_data;
|
|
};
|
|
|
|
unsigned int meson_card_parse_daifmt(struct device_node *node,
|
|
struct device_node *cpu_node);
|
|
|
|
int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_hw_params *params,
|
|
unsigned int mclk_fs);
|
|
|
|
int meson_card_reallocate_links(struct snd_soc_card *card,
|
|
unsigned int num_links);
|
|
int meson_card_parse_dai(struct snd_soc_card *card,
|
|
struct device_node *node,
|
|
struct snd_soc_dai_link_component *dlc);
|
|
int meson_card_set_be_link(struct snd_soc_card *card,
|
|
struct snd_soc_dai_link *link,
|
|
struct device_node *node);
|
|
int meson_card_set_fe_link(struct snd_soc_card *card,
|
|
struct snd_soc_dai_link *link,
|
|
struct device_node *node,
|
|
bool is_playback);
|
|
|
|
int meson_card_probe(struct platform_device *pdev);
|
|
void meson_card_remove(struct platform_device *pdev);
|
|
|
|
#endif /* _MESON_SND_CARD_H */
|