x86: queensbay: Return directly if IGD / SDVO were already disabled
Initialize 'igd' and 'sdvo' to NULL so that we just need to test them against NULL later, to be compatible with that case that IGD and SDVO devices were already in disabled state. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -18,19 +18,17 @@
|
|||||||
|
|
||||||
static int __maybe_unused disable_igd(void)
|
static int __maybe_unused disable_igd(void)
|
||||||
{
|
{
|
||||||
struct udevice *igd, *sdvo;
|
struct udevice *igd = NULL;
|
||||||
|
struct udevice *sdvo = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = dm_pci_bus_find_bdf(TNC_IGD, &igd);
|
/*
|
||||||
if (ret)
|
* In case the IGD and SDVO devices were already in disabled state,
|
||||||
return ret;
|
* we should return and not proceed any further.
|
||||||
if (!igd)
|
*/
|
||||||
return 0;
|
dm_pci_bus_find_bdf(TNC_IGD, &igd);
|
||||||
|
dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
|
||||||
ret = dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
|
if (!igd || !sdvo)
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
if (!sdvo)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user