remove the clock name from pdata
Subsystems (5)
v2 cover remove the clock name from pdata
The clock is defined by device, so the driver knows how many clocks needed by the device.
The orignal way that passing the clock name by pdata is not correct. The following patches fix it.
V2->V1:
typo fix
rebased on latest usb-next
Chao Xie (6):
usb: gadget: mv_udc_core: remove unused clock
usb: otg: mv_otg: remove unused clock
usb: ehci: mv_ehci: remove unused clock
arm: mmp: remove clock from usb pdata for aspenite
arm: mmp: remove clock name from usb pdata for ttc
usb: mv_usb: remove clock name from pdata
arch/arm/mach-mmp/aspenite.c | 6 ----- arch/arm/mach-mmp/ttc_dkb.c | 6 ----- drivers/usb/gadget/mv_udc.h | 3 +- drivers/usb/gadget/mv_udc_core.c | 27 ++++++------------------- drivers/usb/host/ehci-mv.c | 35 +++++++++------------------------ drivers/usb/phy/phy-mv-usb.c | 28 ++++++-------------------- drivers/usb/phy/phy-mv-usb.h | 3 +- include/linux/platform_data/mv_usb.h | 2 - 8 files changed, 26 insertions(+), 84 deletions(-)
Signature · 1 line
1.7.4.1
PATCH v2 1/6 usb: gadget: mv_udc_core: remove unused clock
The origianl understanding of clock is wrong. The UDC controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.
--- drivers/usb/gadget/mv_udc.h | 3 +-- drivers/usb/gadget/mv_udc_core.c | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 22 deletions(-)
drivers/usb/gadget/mv_udc.h +1 -2
@@ -222,8 +222,7 @@ struct mv_udc {struct mv_usb_platform_data *pdata;/* some SOC has mutiple clock sources for USB*/ -unsigned int clknum; -struct clk *clk[0 ]; +struct clk *clk; };/* endpoint data structure */
drivers/usb/gadget/mv_udc_core.c +7 -20
@@ -972,18 +972,12 @@ static struct usb_ep_ops mv_ep_ops = {static void udc_clock_enable (struct mv_udc *udc) { -unsigned int i; - -for (i =0 ; i < udc->clknum; i++) -clk_prepare_enable (udc->clk[i]); +clk_prepare_enable (udc->clk); }static void udc_clock_disable (struct mv_udc *udc) { -unsigned int i; - -for (i =0 ; i < udc->clknum; i++) -clk_disable_unprepare (udc->clk[i]); +clk_disable_unprepare (udc->clk); }static void udc_stop (struct mv_udc *udc)
@@ -2105,7 +2099,6 @@ static int mv_udc_probe(struct platform_device *pdev)struct mv_usb_platform_data *pdata = pdev->dev.platform_data;struct mv_udc *udc;int retval =0 ; -int clk_i =0 ;struct resource *r;size_t size;
@@ -2114,8 +2107,7 @@ static int mv_udc_probe(struct platform_device *pdev)return -ENODEV ; } - size =sizeof (*udc) +sizeof (struct clk *) * pdata->clknum; - udc =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + udc =devm_kzalloc (&pdev->dev,sizeof (*udc),GFP_KERNEL );if (udc ==NULL ) {dev_err (&pdev->dev,"failed to allocate memory for udc\n" );return -ENOMEM ;
@@ -2141,15 +2133,10 @@ static int mv_udc_probe(struct platform_device *pdev) } } - udc->clknum = pdata->clknum; -for (clk_i =0 ; clk_i < udc->clknum; clk_i++) { - udc->clk[clk_i] =devm_clk_get (&pdev->dev, - pdata->clkname[clk_i]); -if (IS_ERR (udc->clk[clk_i])) { - retval =PTR_ERR (udc->clk[clk_i]); -return retval; - } - } +/* udc only have one sysclk. */ + udc->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (udc->clk)) +return PTR_ERR (udc->clk); r =platform_get_resource_byname (udc->dev,IORESOURCE_MEM ,"capregs" );if (r ==NULL ) {
Signature · 1 line
1.7.4.1
PATCH v2 2/6 usb: otg: mv_otg: remove unused clock
In reply to Chao XieThe origianl understanding of clock is wrong. The OTG controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.
--- drivers/usb/phy/phy-mv-usb.c | 28 +++++++--------------------- drivers/usb/phy/phy-mv-usb.h | 3 +-- 2 files changed, 8 insertions(+), 23 deletions(-)
drivers/usb/phy/phy-mv-usb.c +7 -21
@@ -237,18 +237,12 @@ static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)static void otg_clock_enable (struct mv_otg *mvotg) { -unsigned int i; - -for (i =0 ; i < mvotg->clknum; i++) -clk_prepare_enable (mvotg->clk[i]); +clk_prepare_enable (mvotg->clk); }static void otg_clock_disable (struct mv_otg *mvotg) { -unsigned int i; - -for (i =0 ; i < mvotg->clknum; i++) -clk_disable_unprepare (mvotg->clk[i]); +clk_disable_unprepare (mvotg->clk); }static int mv_otg_enable_internal (struct mv_otg *mvotg)
@@ -684,16 +678,14 @@ static int mv_otg_probe(struct platform_device *pdev)struct mv_otg *mvotg;struct usb_otg *otg;struct resource *r; -int retval =0 , clk_i, i; -size_t size; +int retval =0 , i;if (pdata ==NULL ) {dev_err (&pdev->dev,"failed to get platform data\n" );return -ENODEV ; } - size =sizeof (*mvotg) +sizeof (struct clk *) * pdata->clknum; - mvotg =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + mvotg =devm_kzalloc (&pdev->dev,sizeof (*mvotg),GFP_KERNEL );if (!mvotg) {dev_err (&pdev->dev,"failed to allocate memory!\n" );return -ENOMEM ;
@@ -708,15 +700,9 @@ static int mv_otg_probe(struct platform_device *pdev) mvotg->pdev = pdev; mvotg->pdata = pdata; - mvotg->clknum = pdata->clknum; -for (clk_i =0 ; clk_i < mvotg->clknum; clk_i++) { - mvotg->clk[clk_i] =devm_clk_get (&pdev->dev, - pdata->clkname[clk_i]); -if (IS_ERR (mvotg->clk[clk_i])) { - retval =PTR_ERR (mvotg->clk[clk_i]); -return retval; - } - } + mvotg->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (mvotg->clk)) +return PTR_ERR (mvotg->clk); mvotg->qwork =create_singlethread_workqueue ("mv_otg_queue" );if (!mvotg->qwork) {
drivers/usb/phy/phy-mv-usb.h +1 -2
@@ -158,8 +158,7 @@ struct mv_otg {unsigned int active;unsigned int clock_gating; -unsigned int clknum; - struct clk *clk[0]; + struct clk *clk; };#endif
Signature · 1 line
1.7.4.1
PATCH v2 3/6 usb: ehci: mv_ehci: remove unused clock
In reply to Chao XieThe origianl understanding of clock is wrong. The EHCI controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.
--- drivers/usb/host/ehci-mv.c | 35 ++++++++++------------------------- 1 files changed, 10 insertions(+), 25 deletions(-)
drivers/usb/host/ehci-mv.c +10 -25
@@ -33,25 +33,17 @@ struct ehci_hcd_mv {struct mv_usb_platform_data *pdata; -/* clock source and total clock number */ -unsigned int clknum; -struct clk *clk[0 ]; +struct clk *clk; };static void ehci_clock_enable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_prepare_enable (ehci_mv->clk[i]); +clk_prepare_enable (ehci_mv->clk); }static void ehci_clock_disable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_disable_unprepare (ehci_mv->clk[i]); +clk_disable_unprepare (ehci_mv->clk); }static int mv_ehci_enable (struct ehci_hcd_mv *ehci_mv)
@@ -144,9 +136,8 @@ static int mv_ehci_probe(struct platform_device *pdev)struct ehci_hcd *ehci;struct ehci_hcd_mv *ehci_mv;struct resource *r; -int clk_i, retval = -ENODEV ; +int retval = -ENODEV ;u32 offset; -size_t size;if (!pdata) {dev_err (&pdev->dev,"missing platform_data\n" );
@@ -160,8 +151,7 @@ static int mv_ehci_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - size =sizeof (*ehci_mv) +sizeof (struct clk *) * pdata->clknum; - ehci_mv =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + ehci_mv =devm_kzalloc (&pdev->dev,sizeof (*ehci_mv),GFP_KERNEL );if (ehci_mv ==NULL ) {dev_err (&pdev->dev,"cannot allocate ehci_hcd_mv\n" ); retval = -ENOMEM ;
@@ -172,16 +162,11 @@ static int mv_ehci_probe(struct platform_device *pdev) ehci_mv->pdata = pdata; ehci_mv->hcd = hcd; - ehci_mv->clknum = pdata->clknum; -for (clk_i =0 ; clk_i < ehci_mv->clknum; clk_i++) { - ehci_mv->clk[clk_i] = -devm_clk_get (&pdev->dev, pdata->clkname[clk_i]); -if (IS_ERR (ehci_mv->clk[clk_i])) { -dev_err (&pdev->dev,"error get clck \"%s\"\n" , - pdata->clkname[clk_i]); - retval =PTR_ERR (ehci_mv->clk[clk_i]); - goto err_clear_drvdata; - } + ehci_mv->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (ehci_mv->clk)) { +dev_err (&pdev->dev,"error getting clock\n" ); + retval =PTR_ERR (ehci_mv->clk); + goto err_clear_drvdata; } r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phyregs" );
Signature · 1 line
1.7.4.1
PATCH v2 3/6 usb: ehci: mv_ehci: remove unused clock
hi, Alan
This is the patch for EHCI clock fix. Can you help to review and ack it? Thanks.
Quoted 89 lines · Chao Xie
The origianl understanding of clock is wrong. The EHCI controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.Signed-off-by Chao Xie <[email protected]>--- drivers/usb/host/ehci-mv.c | 35 ++++++++++------------------------- 1 files changed, 10 insertions(+), 25 deletions(-)drivers/usb/host/ehci-mv.c +10
-26@@ -33,25 +33,17 @@ struct ehci_hcd_mv {struct mv_usb_platform_data *pdata; -/* clock source and total clock number */ -unsigned int clknum; -struct clk *clk[0 ]; +struct clk *clk; };static void ehci_clock_enable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_prepare_enable (ehci_mv->clk[i]); +clk_prepare_enable (ehci_mv->clk); }static void ehci_clock_disable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_disable_unprepare (ehci_mv->clk[i]); +clk_disable_unprepare (ehci_mv->clk); }static int mv_ehci_enable (struct ehci_hcd_mv *ehci_mv)@@ -144,9 +136,8 @@ static int mv_ehci_probe(struct platform_device *pdev)struct ehci_hcd *ehci;struct ehci_hcd_mv *ehci_mv;struct resource *r; -int clk_i, retval = -ENODEV ; +int retval = -ENODEV ;u32 offset; -size_t size;if (!pdata) {dev_err (&pdev->dev,"missing platform_data\n" );@@ -160,8 +151,7 @@ static int mv_ehci_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - size =sizeof (*ehci_mv) +sizeof (struct clk *) * pdata->clknum; - ehci_mv =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + ehci_mv =devm_kzalloc (&pdev->dev,sizeof (*ehci_mv),GFP_KERNEL );if (ehci_mv ==NULL ) {dev_err (&pdev->dev,"cannot allocate ehci_hcd_mv\n" ); retval = -ENOMEM ;@@ -172,16 +162,11 @@ static int mv_ehci_probe(struct platform_device *pdev) ehci_mv->pdata = pdata; ehci_mv->hcd = hcd; - ehci_mv->clknum = pdata->clknum; -for (clk_i =0 ; clk_i < ehci_mv->clknum; clk_i++) { - ehci_mv->clk[clk_i] = -devm_clk_get (&pdev->dev, pdata->clkname[clk_i]); -if (IS_ERR (ehci_mv->clk[clk_i])) { -dev_err (&pdev->dev,"error get clck \"%s\"\n" , - pdata->clkname[clk_i]); - retval =PTR_ERR (ehci_mv->clk[clk_i]); - goto err_clear_drvdata; - } + ehci_mv->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (ehci_mv->clk)) { +dev_err (&pdev->dev,"error getting clock\n" ); + retval =PTR_ERR (ehci_mv->clk); + goto err_clear_drvdata; } r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phyregs" ); --1.7.4.1
Alan Stern
maintainerPATCH v2 3/6 usb: ehci: mv_ehci: remove unused clock
Quoted 90 lines · Chao Xie
hi, Alan
This is the patch for EHCI clock fix. Can you help to review and ack it? Thanks.
Quoted 85 lines · Chao Xie
The origianl understanding of clock is wrong. The EHCI controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.Signed-off-by Chao Xie <[email protected]>--- drivers/usb/host/ehci-mv.c | 35 ++++++++++------------------------- 1 files changed, 10 insertions(+), 25 deletions(-)drivers/usb/host/ehci-mv.c +10
-25@@ -33,25 +33,17 @@ struct ehci_hcd_mv {struct mv_usb_platform_data *pdata; -/* clock source and total clock number */ -unsigned int clknum; -struct clk *clk[0 ]; +struct clk *clk; };static void ehci_clock_enable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_prepare_enable (ehci_mv->clk[i]); +clk_prepare_enable (ehci_mv->clk); }static void ehci_clock_disable (struct ehci_hcd_mv *ehci_mv) { -unsigned int i; - -for (i =0 ; i < ehci_mv->clknum; i++) -clk_disable_unprepare (ehci_mv->clk[i]); +clk_disable_unprepare (ehci_mv->clk); }static int mv_ehci_enable (struct ehci_hcd_mv *ehci_mv)@@ -144,9 +136,8 @@ static int mv_ehci_probe(struct platform_device *pdev)struct ehci_hcd *ehci;struct ehci_hcd_mv *ehci_mv;struct resource *r; -int clk_i, retval = -ENODEV ; +int retval = -ENODEV ;u32 offset; -size_t size;if (!pdata) {dev_err (&pdev->dev,"missing platform_data\n" );@@ -160,8 +151,7 @@ static int mv_ehci_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - size =sizeof (*ehci_mv) +sizeof (struct clk *) * pdata->clknum; - ehci_mv =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + ehci_mv =devm_kzalloc (&pdev->dev,sizeof (*ehci_mv),GFP_KERNEL );if (ehci_mv ==NULL ) {dev_err (&pdev->dev,"cannot allocate ehci_hcd_mv\n" ); retval = -ENOMEM ;@@ -172,16 +162,11 @@ static int mv_ehci_probe(struct platform_device *pdev) ehci_mv->pdata = pdata; ehci_mv->hcd = hcd; - ehci_mv->clknum = pdata->clknum; -for (clk_i =0 ; clk_i < ehci_mv->clknum; clk_i++) { - ehci_mv->clk[clk_i] = -devm_clk_get (&pdev->dev, pdata->clkname[clk_i]); -if (IS_ERR (ehci_mv->clk[clk_i])) { -dev_err (&pdev->dev,"error get clck \"%s\"\n" , - pdata->clkname[clk_i]); - retval =PTR_ERR (ehci_mv->clk[clk_i]); - goto err_clear_drvdata; - } + ehci_mv->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (ehci_mv->clk)) { +dev_err (&pdev->dev,"error getting clock\n" ); + retval =PTR_ERR (ehci_mv->clk); + goto err_clear_drvdata; }
Quoted 1 line
drivers/usb/host/ehci-mv.c static int mv_ehci_probe(struct platform_device *pdev) · line 172
Quoted 1 line
drivers/usb/host/ehci-mv.c +0
-0r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phyregs" );
Looks okay to me.
PATCH v2 4/6 arm: mmp: remove clock from usb pdata for aspenite
In reply to Chao XieThe clock name will directly get by driver. Removing the name from pdata.
--- arch/arm/mach-mmp/aspenite.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
arch/arm/mach-mmp/aspenite.c +0 -6
@@ -223,13 +223,7 @@ static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = { };#if defined(CONFIG_USB_EHCI_MV ) -static char *pxa168_sph_clock_name[] = { - [0 ] ="PXA168-USBCLK" , -}; -static struct mv_usb_platform_data pxa168_sph_pdata = { - .clknum =1 , - .clkname = pxa168_sph_clock_name, .mode =MV_USB_MODE_HOST , .phy_init = pxa_usb_phy_init, .phy_deinit = pxa_usb_phy_deinit,
Signature · 1 line
1.7.4.1
PATCH v2 4/6 arm: mmp: remove clock from usb pdata for aspenite
hi, Haojian
The patches correct the wrong usage of clock. It finally do not need pass clock by pdata. Can you help to review the patches relates to arch-mmp, and ack it?Thanks.
Quoted 29 lines · Chao Xie
The clock name will directly get by driver. Removing the name from pdata.
Signed-off-by Chao Xie <[email protected]>--- arch/arm/mach-mmp/aspenite.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)arch/arm/mach-mmp/aspenite.c +0
-7@@ -223,13 +223,7 @@ static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = { };#if defined(CONFIG_USB_EHCI_MV ) -static char *pxa168_sph_clock_name[] = { - [0] = "PXA168-USBCLK", -}; -static struct mv_usb_platform_data pxa168_sph_pdata = { - .clknum = 1, - .clkname = pxa168_sph_clock_name, .mode =MV_USB_MODE_HOST , .phy_init = pxa_usb_phy_init, .phy_deinit = pxa_usb_phy_deinit, --1.7.4.1
PATCH v2 4/6 arm: mmp: remove clock from usb pdata for aspenite
Quoted 21 lines · Chao Xie
hi, Haojian
The patches correct the wrong usage of clock. It finally do not need pass clock by pdata. Can you help to review the patches relates to arch-mmp, and ack it?Thanks.Quoted 15 lines · Chao Xie
The clock name will directly get by driver. Removing the name from pdata.
Signed-off-by Chao Xie <[email protected]>--- arch/arm/mach-mmp/aspenite.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)arch/arm/mach-mmp/aspenite.c +0
-0@@ -223,13 +223,7 @@ static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = { };
Quoted 14 lines
Quoted 12 lines
arch/arm/mach-mmp/aspenite.c +0
-7#if defined(CONFIG_USB_EHCI_MV ) -static char *pxa168_sph_clock_name[] = { - [0] = "PXA168-USBCLK", -}; -static struct mv_usb_platform_data pxa168_sph_pdata = { - .clknum = 1, - .clkname = pxa168_sph_clock_name, .mode =MV_USB_MODE_HOST , .phy_init = pxa_usb_phy_init, .phy_deinit = pxa_usb_phy_deinit, --Quoted 2 lines
1.7.4.1
PATCH v2 5/6 arm: mmp: remove clock name from usb pdata for ttc
In reply to Chao XieThe clock name will directly get by driver. Removing the name from pdata.
--- arch/arm/mach-mmp/ttc_dkb.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
arch/arm/mach-mmp/ttc_dkb.c +0 -6
@@ -162,13 +162,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {#ifdef CONFIG_USB_SUPPORT #if defined(CONFIG_USB_MV_UDC ) || defined(CONFIG_USB_EHCI_MV_U2O ) -static char *pxa910_usb_clock_name[] = { - [0 ] ="U2OCLK" , -}; -static struct mv_usb_platform_data ttc_usb_pdata = { - .clknum =1 , - .clkname = pxa910_usb_clock_name, .vbus =NULL , .mode =MV_USB_MODE_OTG , .otg_force_a_bus_req = 1,
Signature · 1 line
1.7.4.1
PATCH v2 5/6 arm: mmp: remove clock name from usb pdata for ttc
Quoted 27 lines · Chao Xie
The clock name will directly get by driver. Removing the name from pdata.
Signed-off-by Chao Xie <[email protected]>--- arch/arm/mach-mmp/ttc_dkb.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)arch/arm/mach-mmp/ttc_dkb.c +0
-7@@ -162,13 +162,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {#ifdef CONFIG_USB_SUPPORT #if defined(CONFIG_USB_MV_UDC ) || defined(CONFIG_USB_EHCI_MV_U2O ) -static char *pxa910_usb_clock_name[] = { - [0] = "U2OCLK", -}; -static struct mv_usb_platform_data ttc_usb_pdata = { - .clknum = 1, - .clkname = pxa910_usb_clock_name, .vbus =NULL , .mode =MV_USB_MODE_OTG , .otg_force_a_bus_req = 1, --
Quoted 2 lines
1.7.4.1
PATCH v2 6/6 usb: mv_usb: remove clock name from pdata
In reply to Chao XieUsing pdata to pass clock name is not correct.
Directly get clock from usb drivers.
--- include/linux/platform_data/mv_usb.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
include/linux/platform_data/mv_usb.h +0 -2
@@ -34,8 +34,6 @@ struct mv_usb_addon_irq { };struct mv_usb_platform_data { -unsigned int clknum; -char **clkname;struct mv_usb_addon_irq *id;/* Only valid for OTG. ID pin change*/ struct mv_usb_addon_irq *vbus;/* valid for OTG/UDC. VBUS change*/
Signature · 1 line
1.7.4.1
PATCH v2 6/6 usb: mv_usb: remove clock name from pdata
Hi,
Quoted 13 lines · Chao Xie
Using pdata to pass clock name is not correct.
Directly get clock from usb drivers.Signed-off-by Chao Xie <[email protected]>--- include/linux/platform_data/mv_usb.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)include/linux/platform_data/mv_usb.h +0
-0
include/linux/platform_data/mv_usb.h struct mv_usb_addon_irq { · line 38
Quoted 5 lines
include/linux/platform_data/mv_usb.h +0
-2@@ -34,8 +34,6 @@ struct mv_usb_addon_irq { };struct mv_usb_platform_data { -unsigned int clknum; -char **clkname;
this patch breaks mv_u3d_core.c, I have added another patch to the series (see below), let me know if this isn't the right fix.
Quoted 1 line
From
49c1bfb43cbd1228abfffbc8d0ebb2e510b93bd7Mon Sep 17 00:00:00 2001
From: Felipe Balbi <[email protected]>
Date: Tue, 2 Apr 2013 11:12:11 +0300
Subject: [PATCH] usb: gadget: mv_u3d_core: remove unused clock
The origianl understanding of clock is wrong. The UDC controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.
--- drivers/usb/gadget/mv_u3d_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/mv_u3d_core.c +1 -1
@@ -1821,7 +1821,7 @@ static int mv_u3d_probe(struct platform_device *dev) u3d->dev = &dev->dev; u3d->vbus = pdata->vbus; - u3d->clk =clk_get (&dev->dev, pdata->clkname[0 ]); + u3d->clk =clk_get (&dev->dev,NULL );if (IS_ERR (u3d->clk)) { retval =PTR_ERR (u3d->clk); goto err_get_clk;
Signature · 11 lines
1.8.2 -- balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130402/7a99e4ac/attachment.sig>
PATCH v2 6/6 usb: mv_usb: remove clock name from pdata
Hi,
Quoted 68 lines
-----Original Message-----
From: Felipe Balbi [mailto:balbi at ti.com]
Sent: 2013?4?2? 16:15
To: Chao Xie
Cc: linux-usb at vger.kernel.org; linux-arm-kernel at lists.infradead.org; haojian.zhuang at gmail.com; balbi at ti.com; xiechao.mail at gmail.com; Yu Xu
Subject: Re: [PATCH V2 6/6] usb:mv_usb: remove clock name from pdataHi,
Quoted 14 lines · Chao Xie
Using pdata to pass clock name is not correct.
Directly get clock from usb drivers.Signed-off-by Chao Xie <[email protected]>--- include/linux/platform_data/mv_usb.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)include/linux/platform_data/mv_usb.h +0
-0include/linux/platform_data/mv_usb.h struct mv_usb_addon_irq { }; · line 37
Quoted 4 lines
include/linux/platform_data/mv_usb.h +0
-2@@ -34,8 +34,6 @@ struct mv_usb_addon_irq { };struct mv_usb_platform_data { -unsigned int clknum; -char **clkname;this patch breaks
mv_u3d_core.c, I have added another patch to the series (see below), let me know if this isn't the right fix.From
49c1bfb43cbd1228abfffbc8d0ebb2e510b93bd7Mon Sep 17 00:00:00 2001
From: Felipe Balbi <[email protected]>
Date: Tue, 2 Apr 2013 11:12:11 +0300
Subject: [PATCH] usb: gadget:mv_u3d_core: remove unused clockThe origianl understanding of clock is wrong. The UDC controller only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device iteself.Cc Chao Xie <[email protected]>Cc Yu Xu <[email protected]>Signed-off-by Felipe Balbi <[email protected]>--- drivers/usb/gadget/mv_u3d_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/mv_u3d_core.c +1
-1@@ -1821,7 +1821,7 @@ static int mv_u3d_probe(struct platform_device *dev) u3d->dev = &dev->dev; u3d->vbus = pdata->vbus; - u3d->clk =clk_get (&dev->dev, pdata->clkname[0 ]); + u3d->clk =clk_get (&dev->dev,NULL );if (IS_ERR (u3d->clk)) { retval =PTR_ERR (u3d->clk);goto
err_get_clk;
--
1.8.2
Quoted 2 lines
--
balbi
Regards,
Yu Xu
v2 cover remove the clock name from pdata
In reply to Chao XieHi,
Quoted 9 lines · Chao Xie
The clock is defined by device, so the driver knows how many clocks needed by the device.
The orignal way that passing the clock name by pdata is not correct. The following patches fix it.
V2->V1:
typo fix
rebased on latest usb-next
Quoted 7 lines
Chao Xie (6):
usb: gadget:mv_udc_core: remove unused clock
usb: otg:mv_otg: remove unused clock
usb: ehci:mv_ehci: remove unused clock
arm: mmp: remove clock from usb pdata for aspenite
arm: mmp: remove clock name from usb pdata for ttc
usb:mv_usb: remove clock name from pdata
how should this series be handled ?
If you want me to carry all patches, I need Acks from other maintainers for ehci and arch/arm/ parts.
Until then, I'm dropping this from my TODO list.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130327/fdd5d4a4/attachment.sig>
v2 cover remove the clock name from pdata
Quoted 22 lines · Felipe Balbi
Hi,
Quoted 9 lines · Chao Xie
The clock is defined by device, so the driver knows how many clocks needed by the device.
The orignal way that passing the clock name by pdata is not correct. The following patches fix it.
V2->V1:
typo fix
rebased on latest usb-nextQuoted 7 lines
Chao Xie (6):
usb: gadget:mv_udc_core: remove unused clock
usb: otg:mv_otg: remove unused clock
usb: ehci:mv_ehci: remove unused clock
arm: mmp: remove clock from usb pdata for aspenite
arm: mmp: remove clock name from usb pdata for ttc
usb:mv_usb: remove clock name from pdatahow should this series be handled ?
Quoted 7 lines
If you want me to carry all patches, I need Acks from other maintainers for ehci and
arch/arm/parts.Until then, I'm dropping this from my TODO list.
--
balbi
hi, Alan
Can you help me to review the EHCI parts?
It changes the way of getting clock. The orginal way uses the pdata to get the clock name, and it is not correct, and the patch fix it. Thanks.