media: ALSA memalloc cleanups
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
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
@@ -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
@@ -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
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 forSNDRV_DMA_TYPE_CONTINOUStype") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop thesnd_dma_continuous_data()usage that became superfluous from the callers.Signed-off-by Takashi Iwai <[email protected]>
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@@ -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@@ -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)
PATCH 2/2 media: tw686x: audio: Avoid non-standard macro usage
In reply to Takashi IwaiPass 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
@@ -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
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.
Signed-off-by Takashi Iwai <[email protected]>
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@@ -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 ;
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 superfluoussnd_dma_continuous_data()
media: tw686x: audio: Avoid non-standard macro usagedrivers/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(-)
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