diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-06-29 15:47:34 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-06-30 18:55:15 +0200 |
commit | 1b4d39428eac80bc76713b1f21a2c85e8900c1b8 (patch) | |
tree | e2b9dfea6be47c785fa55964950c691643d0a232 /payloads/libpayload/drivers/usb | |
parent | de60c8899680f362a908d68efe9e4154ab3380be (diff) | |
download | coreboot-1b4d39428eac80bc76713b1f21a2c85e8900c1b8.tar.gz coreboot-1b4d39428eac80bc76713b1f21a2c85e8900c1b8.tar.bz2 coreboot-1b4d39428eac80bc76713b1f21a2c85e8900c1b8.zip |
libpayload: Make Kconfig bools use IS_ENABLED()
This will make the code work with the different styles
of Kconfig (emit unset bools vs don't emit unset bools)
Roughly, the patch does this, and a little bit of fixing up:
perl -pi -e 's,ifdef (CONFIG_LP_.+?)\b,if IS_ENABLED\($1\),g' `find . -name *.[ch]`
perl -pi -e 's,ifndef (CONFIG_LP_.+?)\b,if !IS_ENABLED\($1\),g' `find . -name *.[ch]`
Change-Id: Ib8a839b056a1f806a8597052e1b571ea3d18a79f
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10711
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/drivers/usb')
-rw-r--r-- | payloads/libpayload/drivers/usb/ehci.c | 2 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/ohci.c | 2 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usb.c | 6 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usbhid.c | 2 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usbinit.c | 20 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/xhci.c | 8 |
6 files changed, 20 insertions, 20 deletions
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c index bda415ff638f..0aa799d09c47 100644 --- a/payloads/libpayload/drivers/usb/ehci.c +++ b/payloads/libpayload/drivers/usb/ehci.c @@ -873,7 +873,7 @@ ehci_init (unsigned long physical_bar) return controller; } -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) hci_t * ehci_pci_init (pcidev_t addr) { diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c index fed1ce9af4cf..83bccb8b895d 100644 --- a/payloads/libpayload/drivers/usb/ohci.c +++ b/payloads/libpayload/drivers/usb/ohci.c @@ -246,7 +246,7 @@ ohci_init (unsigned long physical_bar) return controller; } -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) hci_t * ohci_pci_init (pcidev_t addr) { diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index b97ba6fa086d..6174d639d2c7 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -530,7 +530,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr) break; case hid_device: usb_debug ("HID\n"); -#ifdef CONFIG_LP_USB_HID +#if IS_ENABLED(CONFIG_LP_USB_HID) dev->init = usb_hid_init; return dev->address; #else @@ -548,7 +548,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr) break; case msc_device: usb_debug ("MSC\n"); -#ifdef CONFIG_LP_USB_MSC +#if IS_ENABLED(CONFIG_LP_USB_MSC) dev->init = usb_msc_init; return dev->address; #else @@ -558,7 +558,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr) case hub_device: if (speed < SUPER_SPEED) { usb_debug ("hub (2.0)\n"); -#ifdef CONFIG_LP_USB_HUB +#if IS_ENABLED(CONFIG_LP_USB_HUB) dev->init = usb_hub_init; return dev->address; #else diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index 0ca45e06b2f5..3100d373887a 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -138,7 +138,7 @@ struct layout_maps { static const struct layout_maps *map; static const struct layout_maps keyboard_layouts[] = { -// #ifdef CONFIG_LP_PC_KEYBOARD_LAYOUT_US +// #if IS_ENABLED(CONFIG_LP_PC_KEYBOARD_LAYOUT_US) { .country = "us", .map = { { /* No modifier */ -1, -1, -1, -1, 'a', 'b', 'c', 'd', diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c index 7a5828def7ff..721fde8a930b 100644 --- a/payloads/libpayload/drivers/usb/usbinit.c +++ b/payloads/libpayload/drivers/usb/usbinit.c @@ -37,7 +37,7 @@ #include "dwc2.h" #include <usb/usbdisk.h> -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) /** * Initializes USB controller attached to PCI * @@ -72,7 +72,7 @@ static int usb_controller_initialize(int bus, int dev, int func) pciid >> 16, pciid & 0xFFFF, func); switch (prog_if) { case 0x00: -#ifdef CONFIG_LP_USB_UHCI +#if IS_ENABLED(CONFIG_LP_USB_UHCI) usb_debug("UHCI controller\n"); uhci_pci_init (pci_device); #else @@ -81,7 +81,7 @@ static int usb_controller_initialize(int bus, int dev, int func) break; case 0x10: -#ifdef CONFIG_LP_USB_OHCI +#if IS_ENABLED(CONFIG_LP_USB_OHCI) usb_debug("OHCI controller\n"); ohci_pci_init(pci_device); #else @@ -90,7 +90,7 @@ static int usb_controller_initialize(int bus, int dev, int func) break; case 0x20: -#ifdef CONFIG_LP_USB_EHCI +#if IS_ENABLED(CONFIG_LP_USB_EHCI) usb_debug("EHCI controller\n"); ehci_pci_init(pci_device); #else @@ -99,7 +99,7 @@ static int usb_controller_initialize(int bus, int dev, int func) break; case 0x30: -#ifdef CONFIG_LP_USB_XHCI +#if IS_ENABLED(CONFIG_LP_USB_XHCI) usb_debug("xHCI controller\n"); xhci_pci_init(pci_device); #else @@ -166,7 +166,7 @@ static void usb_scan_pci_bus(int bus) */ int usb_initialize(void) { -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) usb_scan_pci_bus(0); #endif return 0; @@ -175,19 +175,19 @@ int usb_initialize(void) hci_t *usb_add_mmio_hc(hc_type type, void *bar) { switch (type) { -#ifdef CONFIG_LP_USB_OHCI +#if IS_ENABLED(CONFIG_LP_USB_OHCI) case OHCI: return ohci_init((unsigned long)bar); #endif -#ifdef CONFIG_LP_USB_EHCI +#if IS_ENABLED(CONFIG_LP_USB_EHCI) case EHCI: return ehci_init((unsigned long)bar); #endif -#ifdef CONFIG_LP_USB_DWC2 +#if IS_ENABLED(CONFIG_LP_USB_DWC2) case DWC2: return dwc2_init(bar); #endif -#ifdef CONFIG_LP_USB_XHCI +#if IS_ENABLED(CONFIG_LP_USB_XHCI) case XHCI: return xhci_init((unsigned long)bar); #endif diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index 89930e06dfb1..f336f4d6a73c 100644 --- a/payloads/libpayload/drivers/usb/xhci.c +++ b/payloads/libpayload/drivers/usb/xhci.c @@ -88,7 +88,7 @@ xhci_init_cycle_ring(transfer_ring_t *const tr, const size_t ring_size) } /* On Panther Point: switch ports shared with EHCI to xHCI */ -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) static void xhci_switch_ppt_ports(pcidev_t addr) { @@ -112,7 +112,7 @@ xhci_switch_ppt_ports(pcidev_t addr) } #endif -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) /* On Panther Point: switch all ports back to EHCI */ static void xhci_switchback_ppt_ports(pcidev_t addr) @@ -296,7 +296,7 @@ _free_xhci: return NULL; } -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) hci_t * xhci_pci_init (pcidev_t addr) { @@ -411,7 +411,7 @@ xhci_shutdown(hci_t *const controller) xhci_t *const xhci = XHCI_INST(controller); xhci_stop(controller); -#ifdef CONFIG_LP_USB_PCI +#if IS_ENABLED(CONFIG_LP_USB_PCI) if (controller->pcidev) xhci_switchback_ppt_ports(controller->pcidev); #endif |