Skip to contentSkip to conversation

media: ALSA memalloc cleanups

PATCH In review Takashi Iwai 2 participants 7 messages Nov 8, 2019 – Nov 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover media: ALSA memalloc cleanups

Hi,

this is a couple of cleanups for media subsystem wrt ALSA memory allocation API usages. It's based on the recent API changes that are found in for-next of my sound git tree for 5.5 kernel, hence these patches need to be applied on top of it.

So, just give me ACK if they are OK, so that I can apply them.

thanks,

Takashi

===

Takashi Iwai (2):
media: solo6x10: Remove superfluous snd_dma_continuous_data()
media: tw686x: audio: Avoid non-standard macro usage

 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/pci/tw686x/tw686x-audio.c    | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.16.4
#1 lore raw

PATCH 1/2 media: solo6x10: Remove superfluous snd_dma_continuous_data()

The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.

---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
index 30c8f2ec9c3c..eaa57d835ea8 100644
@@ -353,7 +353,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 					SNDRV_DMA_TYPE_CONTINUOUS,
-					snd_dma_continuous_data(GFP_KERNEL),
+					NULL,
 					G723_PERIOD_BYTES * PERIODS,
 					G723_PERIOD_BYTES * PERIODS);
 
drivers/media/usb/usbtv/usbtv-audio.c +1 -2
index 6f108996142d..e746c8ddfc49 100644
@@ -378,8 +378,7 @@ int usbtv_audio_init(struct usbtv *usbtv)
 
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usbtv_pcm_ops);
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
-		snd_dma_continuous_data(GFP_KERNEL), USBTV_AUDIO_BUFFER,
-		USBTV_AUDIO_BUFFER);
+		NULL, USBTV_AUDIO_BUFFER, USBTV_AUDIO_BUFFER);
 
 	rv = snd_card_register(card);
 	if (rv)
Signature · 1 line
2.16.4
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data()

Quoted 7 lines · Takashi Iwai

The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.

Thanks!

Hans

Quoted 33 lines
---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
index 30c8f2ec9c3c..eaa57d835ea8 100644
@@ -353,7 +353,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 					SNDRV_DMA_TYPE_CONTINUOUS,
-					snd_dma_continuous_data(GFP_KERNEL),
+					NULL,
 					G723_PERIOD_BYTES * PERIODS,
 					G723_PERIOD_BYTES * PERIODS);
 
drivers/media/usb/usbtv/usbtv-audio.c +1 -2
index 6f108996142d..e746c8ddfc49 100644
@@ -378,8 +378,7 @@ int usbtv_audio_init(struct usbtv *usbtv)
 
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usbtv_pcm_ops);
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
-		snd_dma_continuous_data(GFP_KERNEL), USBTV_AUDIO_BUFFER,
-		USBTV_AUDIO_BUFFER);
+		NULL, USBTV_AUDIO_BUFFER, USBTV_AUDIO_BUFFER);
 
 	rv = snd_card_register(card);
 	if (rv)
#3 lore raw

PATCH 2/2 media: tw686x: audio: Avoid non-standard macro usage

In reply to Takashi Iwai

Pass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.

---
 drivers/media/pci/tw686x/tw686x-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/tw686x/tw686x-audio.c +1 -1
index 40373bd23381..7786e51d19ae 100644
@@ -300,7 +300,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 				SNDRV_DMA_TYPE_DEV,
-				snd_dma_pci_data(dev->pci_dev),
+				&dev->pci_dev->dev,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
 	return 0;
Signature · 1 line
2.16.4
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage

Quoted 4 lines · Takashi Iwai

Pass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.

Thanks!

Hans

Quoted 18 lines
---
 drivers/media/pci/tw686x/tw686x-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/tw686x/tw686x-audio.c +1 -1
index 40373bd23381..7786e51d19ae 100644
@@ -300,7 +300,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 				SNDRV_DMA_TYPE_DEV,
-				snd_dma_pci_data(dev->pci_dev),
+				&dev->pci_dev->dev,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
 	return 0;
#5 lore raw
In reply to Takashi Iwai
Quoted 8 lines · Takashi Iwai

Hi,

this is a couple of cleanups for media subsystem wrt ALSA memory allocation API usages. It's based on the recent API changes that are found in for-next of my sound git tree for 5.5 kernel, hence these patches need to be applied on top of it.

So, just give me ACK if they are OK, so that I can apply them.

I Acked them. Mauro is very busy so you'll have to do with my Ack, and anyway I maintain those drivers.

Regards,

Hans

Quoted 17 lines

thanks,

Takashi

===

Takashi Iwai (2):
media: solo6x10: Remove superfluous snd_dma_continuous_data()
media: tw686x: audio: Avoid non-standard macro usage

 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/pci/tw686x/tw686x-audio.c    | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)
#6 lore raw
Quoted 9 lines · Hans Verkuil
Quoted 7 lines · Takashi Iwai

Hi,

this is a couple of cleanups for media subsystem wrt ALSA memory allocation API usages. It's based on the recent API changes that are found in for-next of my sound git tree for 5.5 kernel, hence these patches need to be applied on top of it.

Quoted 4 lines
Quoted 1 line

So, just give me ACK if they are OK, so that I can apply them.

I Acked them. Mauro is very busy so you'll have to do with my Ack, and anyway I maintain those drivers.

OK, thanks! I queued these fixed now.

Takashi