diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2020-08-26 19:52:40 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2020-09-14 19:34:11 +0000 |
commit | 79a3de16a177d9c65f366ff413f5ba06c6cc63b4 (patch) | |
tree | 85d2e08362d0c4ada8c5a8e37defafd1e9215ad1 /src/device/pnp_device.c | |
parent | 475978875da1799f48c56bbdd689031d25c1a154 (diff) |
src/{device,include}: Use PNP_IDX_EN instead of magic number
Change-Id: I68590605e261ecaace9f3cea28cfa6ec3b913a8a
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44835
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/device/pnp_device.c')
-rw-r--r-- | src/device/pnp_device.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/device/pnp_device.c b/src/device/pnp_device.c index cd7adf32bc..9fa032e4a9 100644 --- a/src/device/pnp_device.c +++ b/src/device/pnp_device.c @@ -5,6 +5,7 @@ #include <arch/io.h> #include <device/device.h> #include <device/pnp.h> +#include <device/pnp_def.h> /* PNP config mode wrappers */ @@ -56,7 +57,7 @@ void pnp_set_enable(struct device *dev, int enable) { u8 tmp, bitpos; - tmp = pnp_read_config(dev, 0x30); + tmp = pnp_read_config(dev, PNP_IDX_EN); /* Handle virtual devices, which share the same LDN register. */ bitpos = (dev->path.pnp.device >> 8) & 0x7; @@ -66,14 +67,14 @@ void pnp_set_enable(struct device *dev, int enable) else tmp &= ~(1 << bitpos); - pnp_write_config(dev, 0x30, tmp); + pnp_write_config(dev, PNP_IDX_EN, tmp); } int pnp_read_enable(struct device *dev) { u8 tmp, bitpos; - tmp = pnp_read_config(dev, 0x30); + tmp = pnp_read_config(dev, PNP_IDX_EN); /* Handle virtual devices, which share the same LDN register. */ bitpos = (dev->path.pnp.device >> 8) & 0x7; |