From patchwork Tue Jun 17 15:14:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 4367301 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 738109F1C4 for ; Tue, 17 Jun 2014 15:16:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AD9220103 for ; Tue, 17 Jun 2014 15:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16B60201C8 for ; Tue, 17 Jun 2014 15:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932999AbaFQPQK (ORCPT ); Tue, 17 Jun 2014 11:16:10 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:42549 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933340AbaFQPPn (ORCPT ); Tue, 17 Jun 2014 11:15:43 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 3DEA747A687; Tue, 17 Jun 2014 16:15:42 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7tcIgyYEylVm; Tue, 17 Jun 2014 16:15:35 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.179]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 0BCAC47A676; Tue, 17 Jun 2014 16:15:04 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Wwv6F-0002tR-P7; Tue, 17 Jun 2014 16:15:03 +0100 From: Ben Dooks To: linux-usb@vger.kernel.org Cc: balbi@ti.com, gregkh@linuxfoundation.org, linux-sh@vger.kernel.org, Ben Dooks Subject: [PATCH 5/8] r8a66597-udc: cleanup error path Date: Tue, 17 Jun 2014 16:14:58 +0100 Message-Id: <1403018101-11062-6-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403018101-11062-1-git-send-email-ben.dooks@codethink.co.uk> References: <1403018101-11062-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With the updates for devm, the cleanup path no longer needs to check for NULL device state, so remove it and return directly if the irq resource missing Signed-off-by: Ben Dooks --- drivers/usb/gadget/r8a66597-udc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 2662853..9ebe2c0 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -1878,9 +1878,8 @@ static int __init r8a66597_probe(struct platform_device *pdev) irq_trigger = ires->flags & IRQF_TRIGGER_MASK; if (irq < 0) { - ret = -ENODEV; dev_err(dev, "platform_get_irq error.\n"); - goto clean_up; + return -ENODEV; } /* initialize ucd */ @@ -1979,11 +1978,8 @@ clean_up2: clk_put(r8a66597->clk); } clean_up: - if (r8a66597) { - if (r8a66597->ep0_req) - r8a66597_free_request(&r8a66597->ep[0].ep, - r8a66597->ep0_req); - } + if (r8a66597->ep0_req) + r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); return ret; }