soc/intel/common/block/smbus: Use `pci_dev_read_resources()` in read resources
scan-build found a dead assignment, that the value stored to `res` is
never read. Use `pci_dev_read_resources()` instead, as done in
`sb/intel/common/smbus_ops.c` since commit 5f734327
(sb/intel/common/smbus_ops.c: Clean up read resources) avoiding the
assignment.
Change-Id: Ic59063b05a45dca411bf5b56c1abf3dd66ff0437
Found-by: scan-build (coreboot toolchain v0ad5fbd48d 2020-12-24 - clang version 11.0.0)
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54904
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
e882269c11
commit
a081583e3d
|
@ -53,15 +53,14 @@ static void pch_smbus_init(struct device *dev)
|
||||||
|
|
||||||
static void smbus_read_resources(struct device *dev)
|
static void smbus_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
|
pci_dev_read_resources(dev);
|
||||||
|
|
||||||
struct resource *res = new_resource(dev, PCI_BASE_ADDRESS_4);
|
struct resource *res = new_resource(dev, PCI_BASE_ADDRESS_4);
|
||||||
res->base = SMBUS_IO_BASE;
|
res->base = SMBUS_IO_BASE;
|
||||||
res->size = 32;
|
res->size = 32;
|
||||||
res->limit = res->base + res->size - 1;
|
res->limit = res->base + res->size - 1;
|
||||||
res->flags = IORESOURCE_IO | IORESOURCE_FIXED | IORESOURCE_RESERVE |
|
res->flags = IORESOURCE_IO | IORESOURCE_FIXED | IORESOURCE_RESERVE |
|
||||||
IORESOURCE_STORED | IORESOURCE_ASSIGNED;
|
IORESOURCE_STORED | IORESOURCE_ASSIGNED;
|
||||||
|
|
||||||
/* Also add MMIO resource */
|
|
||||||
res = pci_get_resource(dev, PCI_BASE_ADDRESS_0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct device_operations smbus_ops = {
|
static struct device_operations smbus_ops = {
|
||||||
|
|
Loading…
Reference in New Issue