From patchwork Thu Jan 24 15:45:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 2032751 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6379A3FDBC for ; Thu, 24 Jan 2013 15:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754740Ab3AXPrW (ORCPT ); Thu, 24 Jan 2013 10:47:22 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:43815 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754050Ab3AXPrP (ORCPT ); Thu, 24 Jan 2013 10:47:15 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0OFkX2C032682; Thu, 24 Jan 2013 09:46:33 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0OFkXur013046; Thu, 24 Jan 2013 09:46:33 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Thu, 24 Jan 2013 09:46:33 -0600 Received: from localhost (h78-8.vpn.ti.com [172.24.78.8]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0OFkWQ4021697; Thu, 24 Jan 2013 09:46:32 -0600 From: Felipe Balbi To: Linux USB Mailing List CC: , , , , , , , , , , , , Linux OMAP Mailing List , , , , , Felipe Balbi Subject: [RFC/PATCH 05/32] usb: gadget: amd5536udc: let udc-core manage gadget->dev Date: Thu, 24 Jan 2013 17:45:43 +0200 Message-ID: <1359042370-4358-6-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.8.1.rc1.5.g7e0651a In-Reply-To: <1359042370-4358-1-git-send-email-balbi@ti.com> References: <1359042370-4358-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org By simply setting a flag, we drop some boilerplate code. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/amd5536udc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index 3dac001..1827d4c 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c @@ -3080,7 +3080,6 @@ static void udc_pci_remove(struct pci_dev *pdev) if (dev->active) pci_disable_device(pdev); - device_unregister(&dev->gadget.dev); pci_set_drvdata(pdev, NULL); udc_remove(dev); @@ -3276,6 +3275,7 @@ static int udc_probe(struct udc *dev) dev->gadget.dev.release = gadget_release; dev->gadget.name = name; dev->gadget.max_speed = USB_SPEED_HIGH; + dev->gadget.register_my_device = true; /* init registers, interrupts, ... */ startup_registers(dev); @@ -3301,13 +3301,6 @@ static int udc_probe(struct udc *dev) if (retval) goto finished; - retval = device_register(&dev->gadget.dev); - if (retval) { - usb_del_gadget_udc(&dev->gadget); - put_device(&dev->gadget.dev); - goto finished; - } - /* timer init */ init_timer(&udc_timer); udc_timer.function = udc_timer_function;