Refactor usb hub attachment making it easier to read

This commit is contained in:
reinoud 2014-09-21 20:49:31 +00:00
parent 32693e8fdf
commit d6858c32bd

View File

@ -1,4 +1,4 @@
/* $NetBSD: odroid_machdep.c,v 1.33 2014/09/09 21:21:22 reinoud Exp $ */
/* $NetBSD: odroid_machdep.c,v 1.34 2014/09/21 20:49:31 reinoud Exp $ */
/*
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.33 2014/09/09 21:21:22 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.34 2014/09/21 20:49:31 reinoud Exp $");
#include "opt_evbarm_boardtype.h"
#include "opt_exynos.h"
@ -752,7 +752,12 @@ exynos_usb_init_usb3503_hub(device_t self)
prop_dictionary_get_cstring_nocopy(dict, "nreset", &pin_nreset);
prop_dictionary_get_cstring_nocopy(dict, "hubconnect", &pin_hubconnect);
prop_dictionary_get_cstring_nocopy(dict, "nint", &pin_nint);
if (pin_nreset && pin_hubconnect && pin_nint) {
if (!(pin_nreset && pin_hubconnect && pin_nint)) {
aprint_error_dev(self,
"failed to lookup GPIO pins for usb3503 hub init");
return;
}
ok1 = exynos_gpio_pin_reserve(pin_nreset, &nreset_pin);
ok2 = exynos_gpio_pin_reserve(pin_hubconnect, &hubconnect_pin);
ok3 = exynos_gpio_pin_reserve(pin_nint, &nint_pin);
@ -793,11 +798,6 @@ exynos_usb_init_usb3503_hub(device_t self)
DELAY(10000);
/* DONE! */
} else {
aprint_error_dev(self,
"failed to lookup GPIO pins for usb3503 hub init");
}
/* XXX leaving pins claimed! */
}