From patchwork Wed Nov 30 21:42:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majunath Goudar X-Patchwork-Id: 9455021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E45DA60585 for ; Wed, 30 Nov 2016 21:47:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D623A2849B for ; Wed, 30 Nov 2016 21:47:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAD2F284A2; Wed, 30 Nov 2016 21:47:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D10B72849B for ; Wed, 30 Nov 2016 21:47:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCChw-0004CZ-IU; Wed, 30 Nov 2016 21:46:28 +0000 Received: from mail-wj0-x243.google.com ([2a00:1450:400c:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCCfJ-0000yR-PL for linux-arm-kernel@lists.infradead.org; Wed, 30 Nov 2016 21:43:50 +0000 Received: by mail-wj0-x243.google.com with SMTP id he10so9838541wjc.2 for ; Wed, 30 Nov 2016 13:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=B4AVuf0nzJc72XdmKMfT0vw38qHhfhPTPWTLgBv7lMQ=; b=y5oj2OexOOevWV6vMSSAlblifhDk3knfs8sv5PNfGkHcM+1q/zIkCx/NChywAE5Aaz X+45sSQgNrdWFAc7An7vIFV8spBAUkkHJ2cWbGH48fzv1SUJjaXAS+/6CT6DZqVvg/Nr sURDfX1htxSVVKt8ixg4tsUu+HbBOBEZmF+2/xi3CBp2l4xbosSHC0itEquCEoeNk0oi g352xNtk2ep09+kZ7TIViCEuUUoNYt1PqDKlUhoW1d4zt97PlPbVHK6qGUhTOCCMPJeE K440pwQ86IiNDextv2Sm/Fk6LBbFlzHU6sFzIBq8sOs1CXQPRIk5Cr+BWCd+mZA5Q4K/ /t4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B4AVuf0nzJc72XdmKMfT0vw38qHhfhPTPWTLgBv7lMQ=; b=KGjHev17PRpA/CzaLfCMMutbfBKTckvwg/TIUx4vQnFVKA36wKR4EN7A6eVHXXBlBk PcLceK+C3SQGGt9PVgUTK8UfFCfPsmqL17NnAkzookx5SkOO2kEkaUgzLllJa1IApR/f dlIsAQ3v5mFd1kERm2x/qylpELNa8NMAW85/xUc2XHHbtFW5Q2dYWsR1+U+FzOYMDwEo 7j+G9mQt5GqbuK0tLbJELJp/tD/qfkhgXcmhw5ZopFlzo2ZONmHrzIC0fjKA/3res850 5iFHzQorVA8FNqhavDM8Lk3j1m1HgBgmcktGro1lQXYSDDnb+yXH2/pdvcWhPft0HwrR xfkw== X-Gm-Message-State: AKaTC03jev3+IHs0GgXSvPrx6Vzaa0eUypZEYoPyVWBkIkCSUgULly/18tMsFlLKb2nwNA== X-Received: by 10.194.95.194 with SMTP id dm2mr29410382wjb.207.1480542202869; Wed, 30 Nov 2016 13:43:22 -0800 (PST) Received: from manjunath-Aspire-5830T.chello.ie ([79.97.63.33]) by smtp.gmail.com with ESMTPSA id ke6sm59351224wjb.21.2016.11.30.13.43.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Nov 2016 13:43:21 -0800 (PST) From: csmanjuvijay@gmail.com To: csmanjuvijay@gmail.com Subject: [PATCH] USB: OHCI: ohci-s3c2410: remove useless functions Date: Wed, 30 Nov 2016 21:42:46 +0000 Message-Id: <1480542166-7032-1-git-send-email-csmanjuvijay@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161130_134346_278328_3C1D03A7 X-CRM114-Status: GOOD ( 18.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Javier Martinez Canillas , Kukjin Kim , Alan Stern , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Manjunath Goudar The ohci_hcd_s3c2410_drv_probe and ohci_hcd_s3c2410_drv_remove functions are removed as these are useless functions except calling usb_hcd_s3c2410_probe and usb_hcd_s3c2410_remove functions. The usb_hcd_s3c2410_probe function renamed to ohci_hcd_s3c2410_drv_probe and usb_hcd_s3c2410_remove function renamed to ohci_hcd_s3c2410_drv_remove for proper naming. This also removes warnings and errors of checkpatch.pl script. Signed-off-by: Manjunath Goudar Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Javier Martinez Canillas Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/host/ohci-s3c2410.c | 57 +++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index d8e03a8..27b75b3 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -17,7 +17,7 @@ * Thanks to basprog@mail.ru for updates to newer kernels * * This file is licenced under the GPL. -*/ + */ #include #include @@ -43,6 +43,8 @@ static const char hcd_name[] = "ohci-s3c2410"; static struct clk *clk; static struct clk *usb_clk; +static struct hc_driver __read_mostly ohci_s3c2410_hc_driver; + /* forward definitions */ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc); @@ -96,7 +98,7 @@ static void s3c2410_stop_hc(struct platform_device *dev) * * update the status data from the hub with anything that * has been detected by our system -*/ + */ static int ohci_s3c2410_hub_status_data(struct usb_hcd *hcd, char *buf) @@ -135,7 +137,7 @@ ohci_s3c2410_hub_status_data(struct usb_hcd *hcd, char *buf) * * configure the power on a port, by calling the platform device * routine registered with the platform device -*/ + */ static void s3c2410_usb_set_power(struct s3c2410_hcd_info *info, int port, int to) @@ -154,7 +156,7 @@ static void s3c2410_usb_set_power(struct s3c2410_hcd_info *info, * look at control requests to the hub, and see if we need * to take any action or over-ride the results from the * request. -*/ + */ static int ohci_s3c2410_hub_control( struct usb_hcd *hcd, @@ -174,7 +176,8 @@ static int ohci_s3c2410_hub_control( hcd, typeReq, wValue, wIndex, buf, wLength); /* if we are only an humble host without any special capabilities - * process the request straight away and exit */ + * process the request straight away and exit + */ if (info == NULL) { ret = ohci_hub_control(hcd, typeReq, wValue, @@ -285,7 +288,7 @@ static int ohci_s3c2410_hub_control( /* s3c2410_hcd_oc * * handle an over-current report -*/ + */ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc) { @@ -309,7 +312,8 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc) port->oc_changed = 1; /* ok, once over-current is detected, - the port needs to be powered down */ + * the port needs to be powered down + */ s3c2410_usb_set_power(info, portno+1, 0); } } @@ -321,26 +325,29 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc) /* may be called with controller, bus, and devices active */ /* - * usb_hcd_s3c2410_remove - shutdown processing for HCD + * ohci_hcd_s3c2410_remove - shutdown processing for HCD * @dev: USB Host Controller being removed * Context: !in_interrupt() * - * Reverses the effect of usb_hcd_3c2410_probe(), first invoking + * Reverses the effect of ohci_hcd_3c2410_probe(), first invoking * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. * -*/ + */ -static void -usb_hcd_s3c2410_remove(struct usb_hcd *hcd, struct platform_device *dev) +static int +ohci_hcd_s3c2410_remove(struct platform_device *dev) { + struct usb_hcd *hcd = platform_get_drvdata(dev); + usb_remove_hcd(hcd); s3c2410_stop_hc(dev); usb_put_hcd(hcd); + return 0; } /** - * usb_hcd_s3c2410_probe - initialize S3C2410-based HCDs + * ohci_hcd_s3c2410_probe - initialize S3C2410-based HCDs * Context: !in_interrupt() * * Allocates basic resources for this USB host controller, and @@ -348,8 +355,7 @@ usb_hcd_s3c2410_remove(struct usb_hcd *hcd, struct platform_device *dev) * through the hotplug entry's driver_data. * */ -static int usb_hcd_s3c2410_probe(const struct hc_driver *driver, - struct platform_device *dev) +static int ohci_hcd_s3c2410_probe(struct platform_device *dev) { struct usb_hcd *hcd = NULL; struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev); @@ -358,7 +364,7 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver *driver, s3c2410_usb_set_power(info, 1, 1); s3c2410_usb_set_power(info, 2, 1); - hcd = usb_create_hcd(driver, &dev->dev, "s3c24xx"); + hcd = usb_create_hcd(&ohci_s3c2410_hc_driver, &dev->dev, "s3c24xx"); if (hcd == NULL) return -ENOMEM; @@ -404,21 +410,6 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver *driver, /*-------------------------------------------------------------------------*/ -static struct hc_driver __read_mostly ohci_s3c2410_hc_driver; - -static int ohci_hcd_s3c2410_drv_probe(struct platform_device *pdev) -{ - return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); -} - -static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev) -{ - struct usb_hcd *hcd = platform_get_drvdata(pdev); - - usb_hcd_s3c2410_remove(hcd, pdev); - return 0; -} - #ifdef CONFIG_PM static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) { @@ -465,8 +456,8 @@ static const struct of_device_id ohci_hcd_s3c2410_dt_ids[] = { MODULE_DEVICE_TABLE(of, ohci_hcd_s3c2410_dt_ids); static struct platform_driver ohci_hcd_s3c2410_driver = { - .probe = ohci_hcd_s3c2410_drv_probe, - .remove = ohci_hcd_s3c2410_drv_remove, + .probe = ohci_hcd_s3c2410_probe, + .remove = ohci_hcd_s3c2410_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "s3c2410-ohci",