mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
drm: bridge/dw-hdmi: add platform_device_unregister when remove
Change-Id: I7fdc7046b0065329abddbe503c9acd576175670a Signed-off-by: xuhuicong <xhc@rock-chips.com>
This commit is contained in:
parent
e385b101d3
commit
88bd00640f
|
|
@ -13,6 +13,7 @@ struct dw_hdmi_audio_data {
|
|||
|
||||
struct dw_hdmi_i2s_audio_data {
|
||||
struct dw_hdmi *hdmi;
|
||||
struct platform_device *pdev;
|
||||
|
||||
void (*write)(struct dw_hdmi *hdmi, u8 val, int offset);
|
||||
u8 (*read)(struct dw_hdmi *hdmi, int offset);
|
||||
|
|
|
|||
|
|
@ -234,11 +234,23 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
|
|||
pdevinfo.size_data = sizeof(pdata);
|
||||
pdevinfo.dma_mask = DMA_BIT_MASK(32);
|
||||
|
||||
return IS_ERR_OR_NULL(platform_device_register_full(&pdevinfo));
|
||||
audio->pdev = platform_device_register_full(&pdevinfo);
|
||||
return IS_ERR_OR_NULL(audio->pdev);
|
||||
}
|
||||
|
||||
static int snd_dw_hdmi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct dw_hdmi_i2s_audio_data *audio = pdev->dev.platform_data;
|
||||
|
||||
if (!IS_ERR_OR_NULL(audio->pdev))
|
||||
platform_device_unregister(audio->pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver snd_dw_hdmi_driver = {
|
||||
.probe = snd_dw_hdmi_probe,
|
||||
.remove = snd_dw_hdmi_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user