USB: EHCI: Fix compiler warnings with MSM driver
Subsystems (3)
PATCH 3/3 USB: OTG: msm: Fix bug in msm_otg_mode_write
In reply to a message not in the archiveThe driver private data is retrieved incorrectly which results a crash when written into "mode" debugfs file.
--- drivers/usb/otg/msm72k_otg.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/otg/msm72k_otg.c +2 -1
@@ -723,7 +723,8 @@ static int msm_otg_mode_open(struct inode *inode, struct file *file)static ssize_t msm_otg_mode_write (struct file *file,const char __user *ubuf,size_t count,loff_t *ppos) { -struct msm_otg *motg = file->private_data; +struct seq_file *s = file->private_data; +struct msm_otg *motg = s->private;char buf[16 ];struct otg_transceiver *otg = &motg->otg;int status = count;
Signature · 9 lines
1.7.1 -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/3 USB: EHCI: Fix compiler warnings with MSM driver
This patch fixes the following compile warnings
drivers/usb/host/ehci-dbg.c:45: warning: 'dbg_hcs_params' defined but not used drivers/usb/host/ehci-dbg.c:89: warning: 'dbg_hcc_params' defined but not used drivers/usb/host/ehci-lpm.c:21: warning: 'ehci_lpm_set_da' defined but not used drivers/usb/host/ehci-lpm.c:41: warning: 'ehci_lpm_check' defined but not used drivers/usb/host/ehci-hcd.c:668: warning: 'ehci_run' defined but not used
--- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-lpm.c | 5 +++-- drivers/usb/host/ehci-msm.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-hcd.c +1 -1
@@ -669,7 +669,7 @@ static int ehci_init(struct usb_hcd *hcd) }/* start HC running; it's halted, ehci_init() has been run (once) */ -static int ehci_run (struct usb_hcd *hcd) +static int __maybe_unused ehci_run (struct usb_hcd *hcd) {struct ehci_hcd *ehci =hcd_to_ehci (hcd);int retval;
drivers/usb/host/ehci-lpm.c +3 -2
@@ -17,7 +17,8 @@*/ /* this file is part of ehci-hcd.c */ -static int ehci_lpm_set_da (struct ehci_hcd *ehci,int dev_addr,int port_num) +static int __maybe_unused +ehci_lpm_set_da (struct ehci_hcd *ehci,int dev_addr,int port_num) {u32 __iomem portsc;
@@ -37,7 +38,7 @@ static int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)* this function is used to check if the device support LPM * if yes, mark the PORTSC register with PORT_LPM bit */ -static int ehci_lpm_check (struct ehci_hcd *ehci,int port) +static int __maybe_unused ehci_lpm_check (struct ehci_hcd *ehci,int port) {u32 __iomem *portsc ;u32 val32;
drivers/usb/host/ehci-msm.c +3 -1
@@ -1,6 +1,6 @@/* ehci-msm.c - HSUSB Host Controller Driver Implementation * -* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. +* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. * * Partly derived from ehci-fsl.c and ehci-hcd.c * Copyright (c) 2000-2004 by David Brownell
@@ -128,6 +128,8 @@ static int ehci_msm_reset(struct usb_hcd *hcd) ehci->caps =USB_CAPLENGTH ; ehci->regs =USB_CAPLENGTH +HC_LENGTH (ehci_readl (ehci, &ehci->caps->hc_capbase)); +dbg_hcs_params (ehci,"reset" ); +dbg_hcc_params (ehci,"reset" );/* cache the data to minimize the chip reads*/ ehci->hcs_params =ehci_readl (ehci, &ehci->caps->hcs_params);
Signature · 5 lines
1.7.1 -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH 2/3 USB: OTG: msm: Fix compiler warning with CONFIG_PM disabled
This patch fixes the below compiler warning
drivers/usb/otg/msm72k_otg.c:257: warning: 'msm_otg_suspend' defined but not used
--- drivers/usb/otg/msm72k_otg.c | 28 +++++++++++++--------------- 1 files changed, 13 insertions(+), 15 deletions(-)
drivers/usb/otg/msm72k_otg.c +13 -15
@@ -253,6 +253,9 @@ static int msm_otg_reset(struct otg_transceiver *otg) }#define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) +#define PHY_RESUME_TIMEOUT_USEC (100 * 1000) + +#ifdef CONFIG_PM_SLEEP static int msm_otg_suspend (struct msm_otg *motg) {struct otg_transceiver *otg = &motg->otg;
@@ -334,7 +337,6 @@ static int msm_otg_suspend(struct msm_otg *motg)return 0 ; } -#define PHY_RESUME_TIMEOUT_USEC (100 * 1000)static int msm_otg_resume (struct msm_otg *motg) {struct otg_transceiver *otg = &motg->otg;
@@ -399,6 +401,7 @@ skip_phy_resume: return 0; } +#endif static void msm_otg_start_host (struct otg_transceiver *otg,int on) {
@@ -972,7 +975,7 @@ static int __devexit msm_otg_remove(struct platform_device *pdev)msm_otg_debugfs_cleanup ();cancel_work_sync (&motg->sm_work); -msm_otg_resume (motg); +pm_runtime_resume (&pdev->dev);device_init_wakeup (&pdev->dev,0 );pm_runtime_disable (&pdev->dev);
@@ -1050,13 +1053,9 @@ static int msm_otg_runtime_resume(struct device *dev)dev_dbg (dev,"OTG runtime resume\n" );return msm_otg_resume (motg); } -#else -#define msm_otg_runtime_idle NULL -#define msm_otg_runtime_suspend NULL -#define msm_otg_runtime_resume NULL#endif -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int msm_otg_pm_suspend (struct device *dev) {struct msm_otg *motg =dev_get_drvdata (dev);
@@ -1086,25 +1085,24 @@ static int msm_otg_pm_resume(struct device *dev)return 0 ; } -#else -#define msm_otg_pm_suspend NULL -#define msm_otg_pm_resume NULL#endif +#ifdef CONFIG_PM static const struct dev_pm_ops msm_otg_dev_pm_ops = { - .runtime_suspend = msm_otg_runtime_suspend, - .runtime_resume = msm_otg_runtime_resume, - .runtime_idle = msm_otg_runtime_idle, - .suspend = msm_otg_pm_suspend, - .resume = msm_otg_pm_resume, + SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) +SET_RUNTIME_PM_OPS (msm_otg_runtime_suspend, msm_otg_runtime_resume, + msm_otg_runtime_idle) }; +#endif static struct platform_driver msm_otg_driver = { .remove =__devexit_p (msm_otg_remove), .driver = { .name =DRIVER_NAME , .owner =THIS_MODULE , +#ifdef CONFIG_PM .pm = &msm_otg_dev_pm_ops, +#endif }, };
Signature · 5 lines
1.7.1 -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Quoted 8 lines · Pavankumar Kondeti
This patch fixes the following compile warnings
drivers/usb/host/ehci-dbg.c:45: warning: 'dbg_hcs_params' defined but not useddrivers/usb/host/ehci-dbg.c:89: warning: 'dbg_hcc_params' defined but not useddrivers/usb/host/ehci-lpm.c:21: warning: 'ehci_lpm_set_da' defined but not useddrivers/usb/host/ehci-lpm.c:41: warning: 'ehci_lpm_check' defined but not useddrivers/usb/host/ehci-hcd.c:668: warning: 'ehci_run' defined but not used
Quoted 5 lines
Signed-off-by Pavankumar Kondeti <[email protected]>--- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-lpm.c | 5 +++-- drivers/usb/host/ehci-msm.c | 4 +++-
This doesn't apply to the usb-next tree, so I can't take it :(
Care to refresh it and resend?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 15 lines · Greg KH
Quoted 8 lines · Pavankumar Kondeti
This patch fixes the following compile warnings
drivers/usb/host/ehci-dbg.c:45: warning: 'dbg_hcs_params' defined but not useddrivers/usb/host/ehci-dbg.c:89: warning: 'dbg_hcc_params' defined but not useddrivers/usb/host/ehci-lpm.c:21: warning: 'ehci_lpm_set_da' defined but not useddrivers/usb/host/ehci-lpm.c:41: warning: 'ehci_lpm_check' defined but not useddrivers/usb/host/ehci-hcd.c:668: warning: 'ehci_run' defined but not usedQuoted 5 lines
Signed-off-by Pavankumar Kondeti <[email protected]>--- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-lpm.c | 5 +++-- drivers/usb/host/ehci-msm.c | 4 +++-
Quoted 4 lines
This doesn't apply to the usb-next tree, so I can't take it :(
Care to refresh it and resend?
Sorry for the inconvenience. The last 3 warnings or no more with usb-next branch. I am resending the patch shortly.
Thanks,
Pavan
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.