usb: renesas_usbhs: fixup sparse errors for common.c
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 1 Apr 2013 01:34:43 +0000 (18:34 -0700)
committerFelipe Balbi <balbi@ti.com>
Tue, 2 Apr 2013 08:42:48 +0000 (11:42 +0300)
This patch fixup below sparse errors

CHECK   ${RENESAS_USB}/common.c
${RENESAS_USB}/common.c:313:17: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:322:17: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:384:17: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:524:9: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:545:9: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:574:9: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/common.c:606:9: error: incompatible types in conditional expression (different base types)
${RENESAS_USB}/mod_gadget.c:233:28: warning: symbol 'req_clear_feature' was not declared. Should it be static?
${RENESAS_USB}/mod_gadget.c:274:28: warning: symbol 'req_set_feature' was not declared. Should it be static?
${RENESAS_USB}/mod_gadget.c:375:28: warning: symbol 'req_get_status' was not declared. Should it be static?

[ balbi@ti.com : added three sparse fixes to mod_gadget.c ]

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-mackerel.c
arch/sh/boards/mach-ecovec24/setup.c
drivers/usb/renesas_usbhs/mod_gadget.c
include/linux/usb/renesas_usbhs.h

index f2ec0777cfbe89ca5c998dfe1b6d581b5d5320bf..ff8b7ba9b93c9d34337f7c838c65358e2a24a3da 100644 (file)
@@ -169,7 +169,7 @@ static int usbhsf_get_id(struct platform_device *pdev)
        return USBHS_GADGET;
 }
 
-static void usbhsf_power_ctrl(struct platform_device *pdev,
+static int usbhsf_power_ctrl(struct platform_device *pdev,
                              void __iomem *base, int enable)
 {
        struct usbhsf_private *priv = usbhsf_get_priv(pdev);
@@ -223,6 +223,8 @@ static void usbhsf_power_ctrl(struct platform_device *pdev,
                clk_disable(priv->pci);         /* usb work around */
                clk_disable(priv->usb24);       /* usb work around */
        }
+
+       return 0;
 }
 
 static int usbhsf_get_vbus(struct platform_device *pdev)
@@ -239,7 +241,7 @@ static irqreturn_t usbhsf_interrupt(int irq, void *data)
        return IRQ_HANDLED;
 }
 
-static void usbhsf_hardware_exit(struct platform_device *pdev)
+static int usbhsf_hardware_exit(struct platform_device *pdev)
 {
        struct usbhsf_private *priv = usbhsf_get_priv(pdev);
 
@@ -264,6 +266,8 @@ static void usbhsf_hardware_exit(struct platform_device *pdev)
        priv->usbh_base = NULL;
 
        free_irq(IRQ7, pdev);
+
+       return 0;
 }
 
 static int usbhsf_hardware_init(struct platform_device *pdev)
index 7f3a6b7e7b7cfdfd1697560d2e3ecb6b3a6c6f38..a385f570bbfc81b14184f0b79e58a1328361b125 100644 (file)
@@ -155,12 +155,14 @@ static int usbhs_get_vbus(struct platform_device *pdev)
        return !((1 << 7) & __raw_readw(priv->cr2));
 }
 
-static void usbhs_phy_reset(struct platform_device *pdev)
+static int usbhs_phy_reset(struct platform_device *pdev)
 {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
 
        /* init phy */
        __raw_writew(0x8a0a, priv->cr2);
+
+       return 0;
 }
 
 static int usbhs_get_id(struct platform_device *pdev)
@@ -202,7 +204,7 @@ static int usbhs_hardware_init(struct platform_device *pdev)
        return 0;
 }
 
-static void usbhs_hardware_exit(struct platform_device *pdev)
+static int usbhs_hardware_exit(struct platform_device *pdev)
 {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
 
@@ -210,6 +212,8 @@ static void usbhs_hardware_exit(struct platform_device *pdev)
        __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy);
 
        free_irq(IRQ15, pdev);
+
+       return 0;
 }
 
 static u32 usbhs_pipe_cfg[] = {
index db968a585ff0c6ab296e2416369769c7517a4796..979237c18dadac08e6a9c8d3ff41ce49ed879315 100644 (file)
@@ -596,12 +596,14 @@ static int usbhs_get_vbus(struct platform_device *pdev)
        return usbhs_is_connected(usbhs_get_priv(pdev));
 }
 
-static void usbhs_phy_reset(struct platform_device *pdev)
+static int usbhs_phy_reset(struct platform_device *pdev)
 {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
 
        /* init phy */
        __raw_writew(0x8a0a, priv->usbcrcaddr);
+
+       return 0;
 }
 
 static int usbhs0_get_id(struct platform_device *pdev)
@@ -628,11 +630,13 @@ static int usbhs0_hardware_init(struct platform_device *pdev)
        return 0;
 }
 
-static void usbhs0_hardware_exit(struct platform_device *pdev)
+static int usbhs0_hardware_exit(struct platform_device *pdev)
 {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
 
        cancel_delayed_work_sync(&priv->work);
+
+       return 0;
 }
 
 static struct usbhs_private usbhs0_private = {
@@ -735,7 +739,7 @@ static int usbhs1_hardware_init(struct platform_device *pdev)
        return 0;
 }
 
-static void usbhs1_hardware_exit(struct platform_device *pdev)
+static int usbhs1_hardware_exit(struct platform_device *pdev)
 {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
 
@@ -743,6 +747,8 @@ static void usbhs1_hardware_exit(struct platform_device *pdev)
        __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr);
 
        free_irq(IRQ8, pdev);
+
+       return 0;
 }
 
 static int usbhs1_get_id(struct platform_device *pdev)
index aaff7671101b301cedc1e30edf2055fc6aa008c8..764530c85aa9a30ba94dcf5a941c4ce300995fea 100644 (file)
@@ -254,11 +254,13 @@ static int usbhs_get_id(struct platform_device *pdev)
        return gpio_get_value(GPIO_PTB3);
 }
 
-static void usbhs_phy_reset(struct platform_device *pdev)
+static int usbhs_phy_reset(struct platform_device *pdev)
 {
        /* enable vbus if HOST */
        if (!gpio_get_value(GPIO_PTB3))
                gpio_set_value(GPIO_PTB5, 1);
+
+       return 0;
 }
 
 static struct renesas_usbhs_platform_info usbhs_info = {
index c2781bc9dabeb1b55ccb8b2dcf0743989cd2c4b4..ed4949faa70d14502a6669a3fb35b6fb814b35c6 100644 (file)
@@ -230,7 +230,7 @@ static int usbhsg_recip_handler_std_clear_endpoint(struct usbhs_priv *priv,
        return 0;
 }
 
-struct usbhsg_recip_handle req_clear_feature = {
+static struct usbhsg_recip_handle req_clear_feature = {
        .name           = "clear feature",
        .device         = usbhsg_recip_handler_std_control_done,
        .interface      = usbhsg_recip_handler_std_control_done,
@@ -271,7 +271,7 @@ static int usbhsg_recip_handler_std_set_endpoint(struct usbhs_priv *priv,
        return 0;
 }
 
-struct usbhsg_recip_handle req_set_feature = {
+static struct usbhsg_recip_handle req_set_feature = {
        .name           = "set feature",
        .device         = usbhsg_recip_handler_std_set_device,
        .interface      = usbhsg_recip_handler_std_control_done,
@@ -372,7 +372,7 @@ static int usbhsg_recip_handler_std_get_endpoint(struct usbhs_priv *priv,
        return 0;
 }
 
-struct usbhsg_recip_handle req_get_status = {
+static struct usbhsg_recip_handle req_get_status = {
        .name           = "get status",
        .device         = usbhsg_recip_handler_std_get_device,
        .interface      = usbhsg_recip_handler_std_get_interface,
index c5d36c65c33bfe7e77f6a984a66f7a06e1683f84..e452ba6ec6bd937a86f35f2495077c7a0420847a 100644 (file)
@@ -62,14 +62,14 @@ struct renesas_usbhs_platform_callback {
         * Hardware exit function for platform.
         * it is called when driver was removed
         */
-       void (*hardware_exit)(struct platform_device *pdev);
+       int (*hardware_exit)(struct platform_device *pdev);
 
        /*
         * option:
         *
         * for board specific clock control
         */
-       void (*power_ctrl)(struct platform_device *pdev,
+       int (*power_ctrl)(struct platform_device *pdev,
                           void __iomem *base, int enable);
 
        /*
@@ -77,7 +77,7 @@ struct renesas_usbhs_platform_callback {
         *
         * Phy reset for platform
         */
-       void (*phy_reset)(struct platform_device *pdev);
+       int (*phy_reset)(struct platform_device *pdev);
 
        /*
         * get USB ID function