Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: renesas_usbhs: fixup sparse errors for common.c

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>

authored by

Kuninori Morimoto and committed by
Felipe Balbi
225da3e3 ef096542

+30 -14
+6 -2
arch/arm/mach-shmobile/board-armadillo800eva.c
··· 169 169 return USBHS_GADGET; 170 170 } 171 171 172 - static void usbhsf_power_ctrl(struct platform_device *pdev, 172 + static int usbhsf_power_ctrl(struct platform_device *pdev, 173 173 void __iomem *base, int enable) 174 174 { 175 175 struct usbhsf_private *priv = usbhsf_get_priv(pdev); ··· 223 223 clk_disable(priv->pci); /* usb work around */ 224 224 clk_disable(priv->usb24); /* usb work around */ 225 225 } 226 + 227 + return 0; 226 228 } 227 229 228 230 static int usbhsf_get_vbus(struct platform_device *pdev) ··· 241 239 return IRQ_HANDLED; 242 240 } 243 241 244 - static void usbhsf_hardware_exit(struct platform_device *pdev) 242 + static int usbhsf_hardware_exit(struct platform_device *pdev) 245 243 { 246 244 struct usbhsf_private *priv = usbhsf_get_priv(pdev); 247 245 ··· 266 264 priv->usbh_base = NULL; 267 265 268 266 free_irq(IRQ7, pdev); 267 + 268 + return 0; 269 269 } 270 270 271 271 static int usbhsf_hardware_init(struct platform_device *pdev)
+6 -2
arch/arm/mach-shmobile/board-kzm9g.c
··· 155 155 return !((1 << 7) & __raw_readw(priv->cr2)); 156 156 } 157 157 158 - static void usbhs_phy_reset(struct platform_device *pdev) 158 + static int usbhs_phy_reset(struct platform_device *pdev) 159 159 { 160 160 struct usbhs_private *priv = usbhs_get_priv(pdev); 161 161 162 162 /* init phy */ 163 163 __raw_writew(0x8a0a, priv->cr2); 164 + 165 + return 0; 164 166 } 165 167 166 168 static int usbhs_get_id(struct platform_device *pdev) ··· 204 202 return 0; 205 203 } 206 204 207 - static void usbhs_hardware_exit(struct platform_device *pdev) 205 + static int usbhs_hardware_exit(struct platform_device *pdev) 208 206 { 209 207 struct usbhs_private *priv = usbhs_get_priv(pdev); 210 208 ··· 212 210 __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy); 213 211 214 212 free_irq(IRQ15, pdev); 213 + 214 + return 0; 215 215 } 216 216 217 217 static u32 usbhs_pipe_cfg[] = {
+9 -3
arch/arm/mach-shmobile/board-mackerel.c
··· 596 596 return usbhs_is_connected(usbhs_get_priv(pdev)); 597 597 } 598 598 599 - static void usbhs_phy_reset(struct platform_device *pdev) 599 + static int usbhs_phy_reset(struct platform_device *pdev) 600 600 { 601 601 struct usbhs_private *priv = usbhs_get_priv(pdev); 602 602 603 603 /* init phy */ 604 604 __raw_writew(0x8a0a, priv->usbcrcaddr); 605 + 606 + return 0; 605 607 } 606 608 607 609 static int usbhs0_get_id(struct platform_device *pdev) ··· 630 628 return 0; 631 629 } 632 630 633 - static void usbhs0_hardware_exit(struct platform_device *pdev) 631 + static int usbhs0_hardware_exit(struct platform_device *pdev) 634 632 { 635 633 struct usbhs_private *priv = usbhs_get_priv(pdev); 636 634 637 635 cancel_delayed_work_sync(&priv->work); 636 + 637 + return 0; 638 638 } 639 639 640 640 static struct usbhs_private usbhs0_private = { ··· 739 735 return 0; 740 736 } 741 737 742 - static void usbhs1_hardware_exit(struct platform_device *pdev) 738 + static int usbhs1_hardware_exit(struct platform_device *pdev) 743 739 { 744 740 struct usbhs_private *priv = usbhs_get_priv(pdev); 745 741 ··· 747 743 __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); 748 744 749 745 free_irq(IRQ8, pdev); 746 + 747 + return 0; 750 748 } 751 749 752 750 static int usbhs1_get_id(struct platform_device *pdev)
+3 -1
arch/sh/boards/mach-ecovec24/setup.c
··· 254 254 return gpio_get_value(GPIO_PTB3); 255 255 } 256 256 257 - static void usbhs_phy_reset(struct platform_device *pdev) 257 + static int usbhs_phy_reset(struct platform_device *pdev) 258 258 { 259 259 /* enable vbus if HOST */ 260 260 if (!gpio_get_value(GPIO_PTB3)) 261 261 gpio_set_value(GPIO_PTB5, 1); 262 + 263 + return 0; 262 264 } 263 265 264 266 static struct renesas_usbhs_platform_info usbhs_info = {
+3 -3
drivers/usb/renesas_usbhs/mod_gadget.c
··· 230 230 return 0; 231 231 } 232 232 233 - struct usbhsg_recip_handle req_clear_feature = { 233 + static struct usbhsg_recip_handle req_clear_feature = { 234 234 .name = "clear feature", 235 235 .device = usbhsg_recip_handler_std_control_done, 236 236 .interface = usbhsg_recip_handler_std_control_done, ··· 271 271 return 0; 272 272 } 273 273 274 - struct usbhsg_recip_handle req_set_feature = { 274 + static struct usbhsg_recip_handle req_set_feature = { 275 275 .name = "set feature", 276 276 .device = usbhsg_recip_handler_std_set_device, 277 277 .interface = usbhsg_recip_handler_std_control_done, ··· 372 372 return 0; 373 373 } 374 374 375 - struct usbhsg_recip_handle req_get_status = { 375 + static struct usbhsg_recip_handle req_get_status = { 376 376 .name = "get status", 377 377 .device = usbhsg_recip_handler_std_get_device, 378 378 .interface = usbhsg_recip_handler_std_get_interface,
+3 -3
include/linux/usb/renesas_usbhs.h
··· 62 62 * Hardware exit function for platform. 63 63 * it is called when driver was removed 64 64 */ 65 - void (*hardware_exit)(struct platform_device *pdev); 65 + int (*hardware_exit)(struct platform_device *pdev); 66 66 67 67 /* 68 68 * option: 69 69 * 70 70 * for board specific clock control 71 71 */ 72 - void (*power_ctrl)(struct platform_device *pdev, 72 + int (*power_ctrl)(struct platform_device *pdev, 73 73 void __iomem *base, int enable); 74 74 75 75 /* ··· 77 77 * 78 78 * Phy reset for platform 79 79 */ 80 - void (*phy_reset)(struct platform_device *pdev); 80 + int (*phy_reset)(struct platform_device *pdev); 81 81 82 82 /* 83 83 * get USB ID function