Skip to contentSkip to conversation

usb: phy: msm: cast to unsigned long int

PATCH In review Felipe Balbi 4 participants 8 messages Apr 30, 2014 – May 5, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 usb: phy: msm: cast to unsigned long int

this solves the following build warning found when running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
to integer of different size [-Wpointer-to-int-cast]

  pdata->phy_type = (int) id->data;
                    ^

---

all patches are on top of Ivan's 20 patch series.

 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +1 -1
index 9dc7918..c9963c8 100644
@@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (unsigned long int) id->data;
 
 	motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
 	if (IS_ERR(motg->link_rst))
Signature · 1 line
2.0.0.rc1

A message that is not in the archive (sent off-list or not yet received): 1398875916-14461-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org

#2 lore raw

PATCH 2/3 usb: phy: msm: switch over to writel()

Remove that single instance of writel_relaxed()
call which is only available on ARM architecture.

This will let us build test this driver on all
different architectures.

---
 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +1 -1
index c9963c8..13b59ad 100644
@@ -1600,7 +1600,7 @@ static int msm_otg_probe(struct platform_device *pdev)
 		if (IS_ERR(phy_select))
 			return PTR_ERR(phy_select);
 		/* Enable second PHY with the OTG port */
-		writel_relaxed(0x1, phy_select);
+		writel(0x1, phy_select);
 	}
 
 	dev_info(&pdev->dev, "OTG regs = %p\n", motg->regs);
Signature · 6 lines
2.0.0.rc1

--
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
Reviewed-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] usb: phy: msm: switch over to writel()

Quoted 7 lines · Felipe Balbi

Remove that single instance of writel_relaxed()
call which is only available on ARM architecture.

This will let us build test this driver on all
different architectures.

Quoted 17 lines
---
 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +1 -1
index c9963c8..13b59ad 100644
@@ -1600,7 +1600,7 @@ static int msm_otg_probe(struct platform_device *pdev)
 		if (IS_ERR(phy_select))
 			return PTR_ERR(phy_select);
 		/* Enable second PHY with the OTG port */
-		writel_relaxed(0x1, phy_select);
+		writel(0x1, phy_select);
 	}
 
 	dev_info(&pdev->dev, "OTG regs = %p\n", motg->regs);
#4 lore raw
In reply to a message not in the archive
Quoted 21 lines · Felipe Balbi

this solves the following build warning found when running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
to integer of different size [-Wpointer-to-int-cast]

  pdata->phy_type = (int) id->data;
                    ^

---

all patches are on top of Ivan's 20 patch series.

 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +0 -0
index 9dc7918..c9963c8 100644

drivers/usb/phy/phy-msm-usb.c static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · line 1459

Quoted 5 lines
drivers/usb/phy/phy-msm-usb.c +1 -1
@@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (unsigned long int) id->data;

Probably cast to enum msm_usb_phy_type will be better.

Regards,
Ivan

drivers/usb/phy/phy-msm-usb.c static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · line 1462

Quoted 3 lines
drivers/usb/phy/phy-msm-usb.c +0 -0
 	motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
 	if (IS_ERR(motg->link_rst))

--
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

#5 lore raw
Quoted 24 lines · Ivan T. Ivanov
Quoted 23 lines · Felipe Balbi

this solves the following build warning found when running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
to integer of different size [-Wpointer-to-int-cast]

  pdata->phy_type = (int) id->data;
                    ^

---

all patches are on top of Ivan's 20 patch series.

 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +0 -0
index 9dc7918..c9963c8 100644
@@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
Quoted 5 lines

drivers/usb/phy/phy-msm-usb.c static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · line 1459

Quoted 3 lines
drivers/usb/phy/phy-msm-usb.c +1 -1
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (unsigned long int) id->data;

Probably cast to enum msm_usb_phy_type will be better.

will do.

Signature · 1 line
balbi
#6 lore raw
Quoted 25 lines · Felipe Balbi
Quoted 24 lines · Ivan T. Ivanov
Quoted 23 lines · Felipe Balbi

this solves the following build warning found when running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
to integer of different size [-Wpointer-to-int-cast]

  pdata->phy_type = (int) id->data;
                    ^

---

all patches are on top of Ivan's 20 patch series.

 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-msm-usb.c +0 -0
index 9dc7918..c9963c8 100644
@@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
Quoted 7 lines
Quoted 5 lines

drivers/usb/phy/phy-msm-usb.c static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · line 1459

Quoted 3 lines
drivers/usb/phy/phy-msm-usb.c +1 -1
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (unsigned long int) id->data;

Probably cast to enum msm_usb_phy_type will be better.

will do.

commit fe8ef54c824e5b01192462ef82861e65f57d299c

Author: Felipe Balbi <[email protected]>
Date:   Wed Apr 30 11:33:04 2014 -0500

usb: phy: msm: cast to unsigned long int

this solves the following build warning found when running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
to integer of different size [-Wpointer-to-int-cast]
pdata->phy_type = (int) id->data;
^

drivers/usb/phy/phy-msm-usb.c +1 -1
index 9dc7918..591b406 100644
@@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (enum msm_usb_phy_type) id->data;
 
 	motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
 	if (IS_ERR(motg->link_rst))
Signature · 1 line
balbi
#7 lore raw

PATCH 3/3 usb: phy: msm: enable build on other architectures

In reply to Felipe Balbi

By adding COMPILE_TEST to the list of dependencies we can build test this driver on all other architectures which is very valuable for maintainers applying patches and to find silly mistakes during development.

---
 drivers/usb/phy/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/Kconfig +1 -1
index 0c668a3..fbbced8 100644
@@ -172,7 +172,7 @@ config USB_ISP1301
 
 config USB_MSM_OTG
 	tristate "Qualcomm on-chip USB OTG controller support"
-	depends on (USB || USB_GADGET) && (ARCH_MSM || ARCH_QCOM)
+	depends on (USB || USB_GADGET) && (ARCH_MSM || ARCH_QCOM || COMPILE_TEST)
 	select USB_PHY
 	help
 	  Enable this to support the USB OTG transceiver on Qualcomm chips. It
Signature · 1 line
2.0.0.rc1
Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] usb: phy: msm: enable build on other architectures

Quoted 6 lines · Felipe Balbi

By adding COMPILE_TEST to the list of dependencies we can build test this driver on all other architectures which is very valuable for maintainers applying patches and to find silly mistakes during development.

Quoted 17 lines
---
 drivers/usb/phy/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/Kconfig +1 -1
index 0c668a3..fbbced8 100644
@@ -172,7 +172,7 @@ config USB_ISP1301
 
 config USB_MSM_OTG
 	tristate "Qualcomm on-chip USB OTG controller support"
-	depends on (USB || USB_GADGET) && (ARCH_MSM || ARCH_QCOM)
+	depends on (USB || USB_GADGET) && (ARCH_MSM || ARCH_QCOM || COMPILE_TEST)
 	select USB_PHY
 	help
 	  Enable this to support the USB OTG transceiver on Qualcomm chips. It