Skip to content

Commit 9e054ed

Browse files
kawasakijwrdegoede
authored andcommitted
platform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0()
Accesses to resource[] member of struct pci_dev shall be wrapped with pci_resource_n() for future compatibility. Call the helper function in p2sb_read_bar0(). Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by Klara Modin <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 5913320 commit 9e054ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/p2sb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static bool p2sb_valid_resource(struct resource *res)
6565
/* Copy resource from the first BAR of the device in question */
6666
static void p2sb_read_bar0(struct pci_dev *pdev, struct resource *mem)
6767
{
68-
struct resource *bar0 = &pdev->resource[0];
68+
struct resource *bar0 = pci_resource_n(pdev, 0);
6969

7070
/* Make sure we have no dangling pointers in the output */
7171
memset(mem, 0, sizeof(*mem));

0 commit comments

Comments
 (0)