summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 11:32:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 16:01:10 +0200
commitc688d6211f57e1f6f8aaae5522a9223247febbd6 (patch)
tree06cc5a38e860c743613fd92ee31bfc41362d40a7 /drivers/usb/core
parent0a9abb1e15aa64fd79beb73441361e772daf234d (diff)
USB: hcd.c: move assignment out of if () block
We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. Acked-by: Alan Stern <stern@rowland.harvard.edu> CC: Dan Williams <dan.j.williams@intel.com> CC: Antoine Tenart <antoine.tenart@free-electrons.com> CC: Petr Mladek <pmladek@suse.cz> CC: Michal Sojka <sojka@merica.cz> CC: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> CC: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hcd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 45a915ccd71c..be5b2074f906 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2691,7 +2691,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
if ((retval = usb_register_bus(&hcd->self)) < 0)
goto err_register_bus;
- if ((rhdev = usb_alloc_dev(NULL, &hcd->self, 0)) == NULL) {
+ rhdev = usb_alloc_dev(NULL, &hcd->self, 0);
+ if (rhdev == NULL) {
dev_err(hcd->self.controller, "unable to allocate root hub\n");
retval = -ENOMEM;
goto err_allocate_root_hub;