aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge
diff options
context:
space:
mode:
authorVarad Gautam <varadgautam@gmail.com>2015-03-11 09:54:41 +0530
committerMarc Jones <marc.jones@se-eng.com>2015-04-06 19:40:00 +0200
commit06ef04604570d402687245521731053c66888b15 (patch)
treece0fd5b994094f7228d7c18245f8758fd48676ee /src/southbridge
parent015f0aea5dc0cd391ddc34c1db6591d93d08e8a9 (diff)
global: Refactor get_option usage
Restructure get_option() calls to avoid unnecessary return value checks by pre-assigning defaults to the options being retrieved. Change-Id: I9159afe149a8eeed0785d1efd6eee8420b88b8f4 Signed-off-by: Varad Gautam <varadgautam@gmail.com> Reviewed-on: http://review.coreboot.org/8631 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/southbridge')
-rw-r--r--src/southbridge/amd/sb600/sata.c6
-rw-r--r--src/southbridge/intel/i82801dx/lpc.c4
-rw-r--r--src/southbridge/intel/i82801gx/lpc.c4
-rw-r--r--src/southbridge/intel/i82801ix/lpc.c4
4 files changed, 8 insertions, 10 deletions
diff --git a/src/southbridge/amd/sb600/sata.c b/src/southbridge/amd/sb600/sata.c
index 2ff718230a..34ac0aca54 100644
--- a/src/southbridge/amd/sb600/sata.c
+++ b/src/southbridge/amd/sb600/sata.c
@@ -119,10 +119,8 @@ static void sata_init(struct device *dev)
pci_write_config8(dev, 0x40, byte);
// 1 means IDE, 0 means AHCI
- if (get_option(&i, "sata_mode") != CB_SUCCESS) {
- // no cmos option
- i = CONFIG_SATA_MODE;
- }
+ i = CONFIG_SATA_MODE;
+ get_option(&i, "sata_mode");
printk(BIOS_INFO, "%s: setting sata mode = %s\n", __func__, (i == SATA_MODE_IDE)?"ide":"ahci" );
dword = pci_read_config32(dev, 0x8);
diff --git a/src/southbridge/intel/i82801dx/lpc.c b/src/southbridge/intel/i82801dx/lpc.c
index 83d617897e..2f3db86b24 100644
--- a/src/southbridge/intel/i82801dx/lpc.c
+++ b/src/southbridge/intel/i82801dx/lpc.c
@@ -116,8 +116,8 @@ static void i82801dx_power_options(device_t dev)
*
* If the option is not existent (Laptops), use MAINBOARD_POWER_ON.
*/
- if (get_option(&pwr_on, "power_on_after_fail") != CB_SUCCESS)
- pwr_on = MAINBOARD_POWER_ON;
+ pwr_on = MAINBOARD_POWER_ON;
+ get_option(&pwr_on, "power_on_after_fail");
reg8 = pci_read_config8(dev, GEN_PMCON_3);
reg8 &= 0xfe;
diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c
index cbc010605b..b8edfe3fd9 100644
--- a/src/southbridge/intel/i82801gx/lpc.c
+++ b/src/southbridge/intel/i82801gx/lpc.c
@@ -179,8 +179,8 @@ static void i82801gx_power_options(device_t dev)
*
* If the option is not existent (Laptops), use MAINBOARD_POWER_ON.
*/
- if (get_option(&pwr_on, "power_on_after_fail") != CB_SUCCESS)
- pwr_on = MAINBOARD_POWER_ON;
+ pwr_on = MAINBOARD_POWER_ON;
+ get_option(&pwr_on, "power_on_after_fail");
reg8 = pci_read_config8(dev, GEN_PMCON_3);
reg8 &= 0xfe;
diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c
index 0ba33d6759..4f576c4e3d 100644
--- a/src/southbridge/intel/i82801ix/lpc.c
+++ b/src/southbridge/intel/i82801ix/lpc.c
@@ -186,8 +186,8 @@ static void i82801ix_power_options(device_t dev)
*
* If the option is not existent (Laptops), use MAINBOARD_POWER_ON.
*/
- if (get_option(&pwr_on, "power_on_after_fail") != CB_SUCCESS)
- pwr_on = MAINBOARD_POWER_ON;
+ pwr_on = MAINBOARD_POWER_ON;
+ get_option(&pwr_on, "power_on_after_fail");
reg8 = pci_read_config8(dev, D31F0_GEN_PMCON_3);
reg8 &= 0xfe;