summaryrefslogtreecommitdiff
path: root/sound/core/pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r--sound/core/pcm.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 290690fc2abc..bfedf571e021 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -328,13 +328,13 @@ static const char *snd_pcm_oss_format_name(int format)
static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
struct snd_info_buffer *buffer)
{
- struct snd_pcm_info *info __free(kfree) = NULL;
int err;
if (! substream)
return;
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ struct snd_pcm_info *info __free(kfree) =
+ kmalloc_obj(*info);
if (!info)
return;
@@ -592,7 +592,6 @@ static const struct attribute_group *pcm_dev_attr_groups[];
* PM callbacks: we need to deal only with suspend here, as the resume is
* triggered either from user-space or the driver's resume callback
*/
-#ifdef CONFIG_PM_SLEEP
static int do_pcm_suspend(struct device *dev)
{
struct snd_pcm_str *pstr = dev_get_drvdata(dev);
@@ -601,10 +600,9 @@ static int do_pcm_suspend(struct device *dev)
snd_pcm_suspend_all(pstr->pcm);
return 0;
}
-#endif
static const struct dev_pm_ops pcm_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(do_pcm_suspend, NULL)
+ SYSTEM_SLEEP_PM_OPS(do_pcm_suspend, NULL)
};
/* device type for PCM -- basically only for passing PM callbacks */
@@ -659,7 +657,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
}
prev = NULL;
for (idx = 0, prev = NULL; idx < substream_count; idx++) {
- substream = kzalloc(sizeof(*substream), GFP_KERNEL);
+ substream = kzalloc_obj(*substream);
if (!substream)
return -ENOMEM;
substream->pcm = pcm;
@@ -715,7 +713,7 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
return -ENXIO;
if (rpcm)
*rpcm = NULL;
- pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
+ pcm = kzalloc_obj(*pcm);
if (!pcm)
return -ENOMEM;
pcm->card = card;
@@ -937,7 +935,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
if (substream == NULL)
return -EAGAIN;
- runtime = kzalloc(sizeof(*runtime), GFP_KERNEL);
+ runtime = kzalloc_obj(*runtime);
if (runtime == NULL)
return -ENOMEM;