Skip to content

Commit 811cd6e

Browse files
Epicuriusgregkh
authored andcommitted
usb: xhci: make 'sbrn' a local variable
Variable 'sbrn' is used to store the Serial Bus Release Number, which is then only used for a debug message. Thus, 'sbrn' can be a local variable and assigned after the primary HCD check. The SBRN debug message is only printed when a primary HCD is setup. Signed-off-by: Niklas Neronin <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b14485d commit 811cd6e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,9 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
525525
struct xhci_hcd *xhci;
526526
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
527527
int retval;
528+
u8 sbrn;
528529

529530
xhci = hcd_to_xhci(hcd);
530-
if (!xhci->sbrn)
531-
pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn);
532531

533532
/* imod_interval is the interrupt moderation value in nanoseconds. */
534533
xhci->imod_interval = 40000;
@@ -543,7 +542,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
543542
if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
544543
xhci_pme_acpi_rtd3_enable(pdev);
545544

546-
xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn);
545+
pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &sbrn);
546+
xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int)sbrn);
547547

548548
/* Find any debug ports */
549549
return xhci_pci_reinit(xhci, pdev);

drivers/usb/host/xhci.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@ struct xhci_hcd {
14981498
spinlock_t lock;
14991499

15001500
/* packed release number */
1501-
u8 sbrn;
15021501
u16 hci_version;
15031502
u16 max_interrupters;
15041503
/* imod_interval in ns (I * 250ns) */

0 commit comments

Comments
 (0)