From 79cce17436a6d8c276931c28b0e38a20518d9a0e Mon Sep 17 00:00:00 2001 From: Bard liao Date: Thu, 10 Jan 2019 06:29:56 +0800 Subject: [PATCH] ASoC: SOF: intel: hda: remove unrequired null checking sdev->pdata->hw_pdata is assigned in hda_dsp_probe() so sdev->pdata->hw_pdata won't be null in hda_dsp_remove(). Signed-off-by: Bard liao --- sound/soc/sof/intel/hda.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 32ceeb110cb959..d62ea91d3f583a 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -543,17 +543,14 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) (struct sof_intel_hda_dev *)sdev->pdata->hw_pdata; struct hdac_bus *bus = sof_to_bus(sdev); struct pci_dev *pci = sdev->pci; - const struct sof_intel_dsp_desc *chip = NULL; - - if (hda) - chip = hda->desc; + const struct sof_intel_dsp_desc *chip = hda->desc; #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) /* codec removal, invoke bus_device_remove */ snd_hdac_ext_bus_device_remove(bus); #endif - if (hda && (!IS_ERR_OR_NULL(hda->dmic_dev))) + if (!IS_ERR_OR_NULL(hda->dmic_dev)) platform_device_unregister(hda->dmic_dev); /* disable DSP IRQ */