Skip to content

Commit 225da3e

Browse files
morimotoFelipe Balbi
authored andcommitted
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>
1 parent ef09654 commit 225da3e

6 files changed

Lines changed: 30 additions & 14 deletions

File tree

‎arch/arm/mach-shmobile/board-armadillo800eva.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int usbhsf_get_id(struct platform_device *pdev)
169169
return USBHS_GADGET;
170170
}
171171

172-
static void usbhsf_power_ctrl(struct platform_device *pdev,
172+
static int usbhsf_power_ctrl(struct platform_device *pdev,
173173
void __iomem *base, int enable)
174174
{
175175
struct usbhsf_private *priv = usbhsf_get_priv(pdev);
@@ -223,6 +223,8 @@ static void usbhsf_power_ctrl(struct platform_device *pdev,
223223
clk_disable(priv->pci); /* usb work around */
224224
clk_disable(priv->usb24); /* usb work around */
225225
}
226+
227+
return 0;
226228
}
227229

228230
static int usbhsf_get_vbus(struct platform_device *pdev)
@@ -239,7 +241,7 @@ static irqreturn_t usbhsf_interrupt(int irq, void *data)
239241
return IRQ_HANDLED;
240242
}
241243

242-
static void usbhsf_hardware_exit(struct platform_device *pdev)
244+
static int usbhsf_hardware_exit(struct platform_device *pdev)
243245
{
244246
struct usbhsf_private *priv = usbhsf_get_priv(pdev);
245247

@@ -264,6 +266,8 @@ static void usbhsf_hardware_exit(struct platform_device *pdev)
264266
priv->usbh_base = NULL;
265267

266268
free_irq(IRQ7, pdev);
269+
270+
return 0;
267271
}
268272

269273
static int usbhsf_hardware_init(struct platform_device *pdev)

‎arch/arm/mach-shmobile/board-kzm9g.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ static int usbhs_get_vbus(struct platform_device *pdev)
155155
return !((1 << 7) & __raw_readw(priv->cr2));
156156
}
157157

158-
static void usbhs_phy_reset(struct platform_device *pdev)
158+
static int usbhs_phy_reset(struct platform_device *pdev)
159159
{
160160
struct usbhs_private *priv = usbhs_get_priv(pdev);
161161

162162
/* init phy */
163163
__raw_writew(0x8a0a, priv->cr2);
164+
165+
return 0;
164166
}
165167

166168
static int usbhs_get_id(struct platform_device *pdev)
@@ -202,14 +204,16 @@ static int usbhs_hardware_init(struct platform_device *pdev)
202204
return 0;
203205
}
204206

205-
static void usbhs_hardware_exit(struct platform_device *pdev)
207+
static int usbhs_hardware_exit(struct platform_device *pdev)
206208
{
207209
struct usbhs_private *priv = usbhs_get_priv(pdev);
208210

209211
/* clear interrupt status */
210212
__raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy);
211213

212214
free_irq(IRQ15, pdev);
215+
216+
return 0;
213217
}
214218

215219
static u32 usbhs_pipe_cfg[] = {

‎arch/arm/mach-shmobile/board-mackerel.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,14 @@ static int usbhs_get_vbus(struct platform_device *pdev)
596596
return usbhs_is_connected(usbhs_get_priv(pdev));
597597
}
598598

599-
static void usbhs_phy_reset(struct platform_device *pdev)
599+
static int usbhs_phy_reset(struct platform_device *pdev)
600600
{
601601
struct usbhs_private *priv = usbhs_get_priv(pdev);
602602

603603
/* init phy */
604604
__raw_writew(0x8a0a, priv->usbcrcaddr);
605+
606+
return 0;
605607
}
606608

607609
static int usbhs0_get_id(struct platform_device *pdev)
@@ -628,11 +630,13 @@ static int usbhs0_hardware_init(struct platform_device *pdev)
628630
return 0;
629631
}
630632

631-
static void usbhs0_hardware_exit(struct platform_device *pdev)
633+
static int usbhs0_hardware_exit(struct platform_device *pdev)
632634
{
633635
struct usbhs_private *priv = usbhs_get_priv(pdev);
634636

635637
cancel_delayed_work_sync(&priv->work);
638+
639+
return 0;
636640
}
637641

638642
static struct usbhs_private usbhs0_private = {
@@ -735,14 +739,16 @@ static int usbhs1_hardware_init(struct platform_device *pdev)
735739
return 0;
736740
}
737741

738-
static void usbhs1_hardware_exit(struct platform_device *pdev)
742+
static int usbhs1_hardware_exit(struct platform_device *pdev)
739743
{
740744
struct usbhs_private *priv = usbhs_get_priv(pdev);
741745

742746
/* clear interrupt status */
743747
__raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr);
744748

745749
free_irq(IRQ8, pdev);
750+
751+
return 0;
746752
}
747753

748754
static int usbhs1_get_id(struct platform_device *pdev)

‎arch/sh/boards/mach-ecovec24/setup.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,13 @@ static int usbhs_get_id(struct platform_device *pdev)
254254
return gpio_get_value(GPIO_PTB3);
255255
}
256256

257-
static void usbhs_phy_reset(struct platform_device *pdev)
257+
static int usbhs_phy_reset(struct platform_device *pdev)
258258
{
259259
/* enable vbus if HOST */
260260
if (!gpio_get_value(GPIO_PTB3))
261261
gpio_set_value(GPIO_PTB5, 1);
262+
263+
return 0;
262264
}
263265

264266
static struct renesas_usbhs_platform_info usbhs_info = {

‎drivers/usb/renesas_usbhs/mod_gadget.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int usbhsg_recip_handler_std_clear_endpoint(struct usbhs_priv *priv,
230230
return 0;
231231
}
232232

233-
struct usbhsg_recip_handle req_clear_feature = {
233+
static struct usbhsg_recip_handle req_clear_feature = {
234234
.name = "clear feature",
235235
.device = usbhsg_recip_handler_std_control_done,
236236
.interface = usbhsg_recip_handler_std_control_done,
@@ -271,7 +271,7 @@ static int usbhsg_recip_handler_std_set_endpoint(struct usbhs_priv *priv,
271271
return 0;
272272
}
273273

274-
struct usbhsg_recip_handle req_set_feature = {
274+
static struct usbhsg_recip_handle req_set_feature = {
275275
.name = "set feature",
276276
.device = usbhsg_recip_handler_std_set_device,
277277
.interface = usbhsg_recip_handler_std_control_done,
@@ -372,7 +372,7 @@ static int usbhsg_recip_handler_std_get_endpoint(struct usbhs_priv *priv,
372372
return 0;
373373
}
374374

375-
struct usbhsg_recip_handle req_get_status = {
375+
static struct usbhsg_recip_handle req_get_status = {
376376
.name = "get status",
377377
.device = usbhsg_recip_handler_std_get_device,
378378
.interface = usbhsg_recip_handler_std_get_interface,

‎include/linux/usb/renesas_usbhs.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ struct renesas_usbhs_platform_callback {
6262
* Hardware exit function for platform.
6363
* it is called when driver was removed
6464
*/
65-
void (*hardware_exit)(struct platform_device *pdev);
65+
int (*hardware_exit)(struct platform_device *pdev);
6666

6767
/*
6868
* option:
6969
*
7070
* for board specific clock control
7171
*/
72-
void (*power_ctrl)(struct platform_device *pdev,
72+
int (*power_ctrl)(struct platform_device *pdev,
7373
void __iomem *base, int enable);
7474

7575
/*
7676
* option:
7777
*
7878
* Phy reset for platform
7979
*/
80-
void (*phy_reset)(struct platform_device *pdev);
80+
int (*phy_reset)(struct platform_device *pdev);
8181

8282
/*
8383
* get USB ID function

0 commit comments

Comments
 (0)