aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/r8a66597-udc.c11
-rw-r--r--drivers/usb/gadget/r8a66597-udc.h5
2 files changed, 3 insertions, 13 deletions
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index f3ac2a20c27c..5a80751accb7 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1831,12 +1831,12 @@ static int __exit r8a66597_remove(struct platform_device *pdev)
1831 iounmap(r8a66597->sudmac_reg); 1831 iounmap(r8a66597->sudmac_reg);
1832 free_irq(platform_get_irq(pdev, 0), r8a66597); 1832 free_irq(platform_get_irq(pdev, 0), r8a66597);
1833 r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); 1833 r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req);
1834#ifdef CONFIG_HAVE_CLK 1834
1835 if (r8a66597->pdata->on_chip) { 1835 if (r8a66597->pdata->on_chip) {
1836 clk_disable(r8a66597->clk); 1836 clk_disable(r8a66597->clk);
1837 clk_put(r8a66597->clk); 1837 clk_put(r8a66597->clk);
1838 } 1838 }
1839#endif 1839
1840 device_unregister(&r8a66597->gadget.dev); 1840 device_unregister(&r8a66597->gadget.dev);
1841 kfree(r8a66597); 1841 kfree(r8a66597);
1842 return 0; 1842 return 0;
@@ -1868,9 +1868,7 @@ static int __init r8a66597_sudmac_ioremap(struct r8a66597 *r8a66597,
1868 1868
1869static int __init r8a66597_probe(struct platform_device *pdev) 1869static int __init r8a66597_probe(struct platform_device *pdev)
1870{ 1870{
1871#ifdef CONFIG_HAVE_CLK
1872 char clk_name[8]; 1871 char clk_name[8];
1873#endif
1874 struct resource *res, *ires; 1872 struct resource *res, *ires;
1875 int irq; 1873 int irq;
1876 void __iomem *reg = NULL; 1874 void __iomem *reg = NULL;
@@ -1934,7 +1932,6 @@ static int __init r8a66597_probe(struct platform_device *pdev)
1934 r8a66597->timer.data = (unsigned long)r8a66597; 1932 r8a66597->timer.data = (unsigned long)r8a66597;
1935 r8a66597->reg = reg; 1933 r8a66597->reg = reg;
1936 1934
1937#ifdef CONFIG_HAVE_CLK
1938 if (r8a66597->pdata->on_chip) { 1935 if (r8a66597->pdata->on_chip) {
1939 snprintf(clk_name, sizeof(clk_name), "usb%d", pdev->id); 1936 snprintf(clk_name, sizeof(clk_name), "usb%d", pdev->id);
1940 r8a66597->clk = clk_get(&pdev->dev, clk_name); 1937 r8a66597->clk = clk_get(&pdev->dev, clk_name);
@@ -1946,7 +1943,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
1946 } 1943 }
1947 clk_enable(r8a66597->clk); 1944 clk_enable(r8a66597->clk);
1948 } 1945 }
1949#endif 1946
1950 if (r8a66597->pdata->sudmac) { 1947 if (r8a66597->pdata->sudmac) {
1951 ret = r8a66597_sudmac_ioremap(r8a66597, pdev); 1948 ret = r8a66597_sudmac_ioremap(r8a66597, pdev);
1952 if (ret < 0) 1949 if (ret < 0)
@@ -2006,13 +2003,11 @@ err_add_udc:
2006clean_up3: 2003clean_up3:
2007 free_irq(irq, r8a66597); 2004 free_irq(irq, r8a66597);
2008clean_up2: 2005clean_up2:
2009#ifdef CONFIG_HAVE_CLK
2010 if (r8a66597->pdata->on_chip) { 2006 if (r8a66597->pdata->on_chip) {
2011 clk_disable(r8a66597->clk); 2007 clk_disable(r8a66597->clk);
2012 clk_put(r8a66597->clk); 2008 clk_put(r8a66597->clk);
2013 } 2009 }
2014clean_up_dev: 2010clean_up_dev:
2015#endif
2016 device_unregister(&r8a66597->gadget.dev); 2011 device_unregister(&r8a66597->gadget.dev);
2017clean_up: 2012clean_up:
2018 if (r8a66597) { 2013 if (r8a66597) {
diff --git a/drivers/usb/gadget/r8a66597-udc.h b/drivers/usb/gadget/r8a66597-udc.h
index 99908c76ccd1..45c4b2df1785 100644
--- a/drivers/usb/gadget/r8a66597-udc.h
+++ b/drivers/usb/gadget/r8a66597-udc.h
@@ -13,10 +13,7 @@
13#ifndef __R8A66597_H__ 13#ifndef __R8A66597_H__
14#define __R8A66597_H__ 14#define __R8A66597_H__
15 15
16#ifdef CONFIG_HAVE_CLK
17#include <linux/clk.h> 16#include <linux/clk.h>
18#endif
19
20#include <linux/usb/r8a66597.h> 17#include <linux/usb/r8a66597.h>
21 18
22#define R8A66597_MAX_SAMPLING 10 19#define R8A66597_MAX_SAMPLING 10
@@ -92,9 +89,7 @@ struct r8a66597 {
92 void __iomem *reg; 89 void __iomem *reg;
93 void __iomem *sudmac_reg; 90 void __iomem *sudmac_reg;
94 91
95#ifdef CONFIG_HAVE_CLK
96 struct clk *clk; 92 struct clk *clk;
97#endif
98 struct r8a66597_platdata *pdata; 93 struct r8a66597_platdata *pdata;
99 94
100 struct usb_gadget gadget; 95 struct usb_gadget gadget;