Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

2015-03-05 Thread Axel Lin
2015-03-05 18:48 GMT+08:00 Roger Quadros rog...@ti.com: Hi Alex, It's Axel. Since we're anyways going to fail probe for !CONFIG_OF, why do you want to add the unnecessary device table to the kernel? what are you benefiting from this change? If the driver works for both dt case and non-dt

[PATCH 2/3] phy: omap-usb2: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

2015-03-05 Thread Axel Lin
if !CONFIG_OF, the probe fails. This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-omap-usb2.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/phy/phy-omap-usb2

[PATCH 3/3] phy: ti-pipe3: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

2015-03-05 Thread Axel Lin
if !CONFIG_OF, the probe fails. This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-ti-pipe3.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/phy/phy-ti-pipe3

[PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

2015-03-05 Thread Axel Lin
if !CONFIG_OF, the probe fails. This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-omap-control.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/phy/phy

[PATCH] phy: core: Fixup return value of phy_exit when !pm_runtime_enabled

2015-03-05 Thread Axel Lin
When phy_pm_runtime_get_sync() returns -ENOTSUPP, phy_exit() also returns -ENOTSUPP if !phy-ops-exit. Fix it. Also move the code to override ret close to the code we got ret. I think it is less error prone this way. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-core.c | 7

[RFC][PATCH 2/2] phy: miphy365x: Convert to use phy.h instead of phy-miphy365x.h

2015-03-04 Thread Axel Lin
The defines in phy-miphy365x.h are all covered in phy.h: MIPHY_TYPE_SATA == PHY_TYPE_STA MIPHY_TYPE_PCIE == PHY_TYPE_PCIE MIPPHY_TYPE_USB == PHY_TYPE_USB2 So covert to use phy.h and then delete phy-miphy365x.h. Signed-off-by: Axel Lin --- Documentation/devicetree/bindings/ata/ahci-st.txt

[PATCH 1/2] phy: miphy365x: Convert to devm_kcalloc and fix wrong sizof

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. In additional, use sizeof(phy) is incorrect, fix it. Signed-off-by: Axel Lin --- drivers/phy/phy-miphy365x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c

[PATCH 2/2] phy: miphy28lp: Use PTR_ERR_OR_ZERO

2015-03-04 Thread Axel Lin
PTR_ERR_OR_ZERO simplifies the code. Signed-off-by: Axel Lin --- drivers/phy/phy-miphy28lp.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 9334352..c4cc11d 100644 --- a/drivers/phy/phy-miphy28lp.c +++ b

[PATCH 1/2] phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. In additional, use sizeof(phy) is incorrect, fix it. Signed-off-by: Axel Lin --- This patch is on top of below patch: [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times drivers/phy/phy-miphy28lp.c | 5 ++--- 1 file

[PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. Signed-off-by: Axel Lin --- drivers/phy/phy-berlin-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c index 099eee8..6f3e06d 100644 --- a/drivers/phy/phy

[PATCH] phy: xgene: Use PTR_ERR_OR_ZERO

2015-03-04 Thread Axel Lin
Also remove unneeded goto and rc variable. Signed-off-by: Axel Lin --- drivers/phy/phy-xgene.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 2263cd0..385362e 100644 --- a/drivers/phy/phy

[PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-berlin-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c index 099eee8..6f3e06d 100644

[PATCH 1/2] phy: miphy365x: Convert to devm_kcalloc and fix wrong sizof

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. In additional, use sizeof(phy) is incorrect, fix it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-miphy365x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy

[PATCH] phy: xgene: Use PTR_ERR_OR_ZERO

2015-03-04 Thread Axel Lin
Also remove unneeded goto and rc variable. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-xgene.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 2263cd0..385362e 100644

[PATCH 2/2] phy: miphy28lp: Use PTR_ERR_OR_ZERO

2015-03-04 Thread Axel Lin
PTR_ERR_OR_ZERO simplifies the code. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-miphy28lp.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 9334352..c4cc11d 100644 --- a/drivers/phy/phy

[PATCH 1/2] phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof

2015-03-04 Thread Axel Lin
Prefer devm_kcalloc over devm_kzalloc with multiply. In additional, use sizeof(phy) is incorrect, fix it. Signed-off-by: Axel Lin axel@ingics.com --- This patch is on top of below patch: [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times drivers/phy/phy

[RFC][PATCH 2/2] phy: miphy365x: Convert to use phy.h instead of phy-miphy365x.h

2015-03-04 Thread Axel Lin
The defines in phy-miphy365x.h are all covered in phy.h: MIPHY_TYPE_SATA == PHY_TYPE_STA MIPHY_TYPE_PCIE == PHY_TYPE_PCIE MIPPHY_TYPE_USB == PHY_TYPE_USB2 So covert to use phy.h and then delete phy-miphy365x.h. Signed-off-by: Axel Lin axel@ingics.com --- Documentation/devicetree/bindings

[PATCH] phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path

2015-03-03 Thread Axel Lin
If rockchip_usb_phy_power() fails, we need to call clk_disable_unprepare() before return. This is to ensure we have balanced clk_enable/disable calls. Also remove unneeded ret checking in rockchip_usb_phy_power_off. Signed-off-by: Axel Lin --- drivers/phy/phy-rockchip-usb.c | 6 +++--- 1 file

[PATCH] phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation

2015-03-03 Thread Axel Lin
Code simplification. No functional change. Signed-off-by: Axel Lin --- drivers/phy/phy-ti-pipe3.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index 95c88f9..ed72b0d 100644 --- a/drivers/phy/phy-ti-pipe3.c

[PATCH] phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path

2015-03-03 Thread Axel Lin
If rockchip_usb_phy_power() fails, we need to call clk_disable_unprepare() before return. This is to ensure we have balanced clk_enable/disable calls. Also remove unneeded ret checking in rockchip_usb_phy_power_off. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-rockchip-usb.c

[PATCH] phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation

2015-03-03 Thread Axel Lin
Code simplification. No functional change. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-ti-pipe3.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index 95c88f9..ed72b0d 100644 --- a/drivers

[PATCH] phy: samsung-usb2: Remove NULL terminating entry from phys array

2015-03-02 Thread Axel Lin
Current code uses num_phys settings to tell the number of entries in phys. Thus remove the NULL terminating entry from phys array which is not necessary. Signed-off-by: Axel Lin --- drivers/phy/phy-exynos4210-usb2.c | 1 - drivers/phy/phy-exynos4x12-usb2.c | 1 - drivers/phy/phy-exynos5250-usb2

[PATCH] phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe

2015-03-02 Thread Axel Lin
Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it. Signed-off-by: Axel Lin --- drivers/phy/phy-qcom-ufs.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH] phy: hix5hd2-sata: Check return value of platform_get_resource

2015-03-02 Thread Axel Lin
This prevent NULL pointer dereference if res is NULL. Signed-off-by: Axel Lin --- This patch replaces [PATCH] phy: hix5hd2-sata: Convert to use devm_ioremap_resource, as zhangfei pinted out that the memory region is shared with sata controller so devm_request_mem_region would fail. drivers/phy

[PATCH] phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe

2015-03-02 Thread Axel Lin
Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-qcom-ufs.c | 1 + 1 file changed, 1

[PATCH] phy: samsung-usb2: Remove NULL terminating entry from phys array

2015-03-02 Thread Axel Lin
Current code uses num_phys settings to tell the number of entries in phys. Thus remove the NULL terminating entry from phys array which is not necessary. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-exynos4210-usb2.c | 1 - drivers/phy/phy-exynos4x12-usb2.c | 1 - drivers/phy

[PATCH] phy: hix5hd2-sata: Check return value of platform_get_resource

2015-03-02 Thread Axel Lin
This prevent NULL pointer dereference if res is NULL. Signed-off-by: Axel Lin axel@ingics.com --- This patch replaces [PATCH] phy: hix5hd2-sata: Convert to use devm_ioremap_resource, as zhangfei pinted out that the memory region is shared with sata controller so devm_request_mem_region would

[PATCH] phy: hix5hd2-sata: Convert to use devm_ioremap_resource

2015-03-01 Thread Axel Lin
devm_ioremap_resource() also has sanity check for the res argument which is missed in current code. Signed-off-by: Axel Lin --- drivers/phy/phy-hix5hd2-sata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/phy-hix5hd2-sata.c b/drivers/phy/phy-hix5hd2

[PATCH] phy: berlin-usb: Use PTR_ERR_OR_ZERO

2015-03-01 Thread Axel Lin
PTR_ERR_OR_ZERO simplifies the code. Signed-off-by: Axel Lin --- drivers/phy/phy-berlin-usb.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/phy/phy-berlin-usb.c b/drivers/phy/phy-berlin-usb.c index c8a8d53..9f7cc7e 100644 --- a/drivers/phy/phy-berlin-usb.c

[PATCH] phy: twl4030-usb: Remove redundant assignment for twl->linkstat

2015-03-01 Thread Axel Lin
It's pointless to set twl->linkstat twice. Signed-off-by: Axel Lin --- drivers/phy/phy-twl4030-usb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 8e87f54..bc42d6a 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/driv

[PATCH] phy: berlin-usb: Use PTR_ERR_OR_ZERO

2015-03-01 Thread Axel Lin
PTR_ERR_OR_ZERO simplifies the code. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-berlin-usb.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/phy/phy-berlin-usb.c b/drivers/phy/phy-berlin-usb.c index c8a8d53..9f7cc7e 100644 --- a/drivers/phy

[PATCH] phy: twl4030-usb: Remove redundant assignment for twl-linkstat

2015-03-01 Thread Axel Lin
It's pointless to set twl-linkstat twice. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-twl4030-usb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 8e87f54..bc42d6a 100644 --- a/drivers/phy/phy-twl4030

[PATCH] phy: hix5hd2-sata: Convert to use devm_ioremap_resource

2015-03-01 Thread Axel Lin
devm_ioremap_resource() also has sanity check for the res argument which is missed in current code. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-hix5hd2-sata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/phy-hix5hd2-sata.c b/drivers

[PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]

2015-02-27 Thread Axel Lin
Current code uses args->args[0] as array subscript of phy_drd->phys[]. So the valid value range for args->args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 1. Signed-off-by: Axel Lin --- drivers/phy/phy-exynos5-usbdrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver

[PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args-args[0]

2015-02-27 Thread Axel Lin
Current code uses args-args[0] as array subscript of phy_drd-phys[]. So the valid value range for args-args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 1. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-exynos5-usbdrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function

2015-02-26 Thread Axel Lin
If IS_ERR(state->regs) the .probe fails. So IS_ERR(state->regs) test in exynos_dp_video_phy_pwr_isol() is not necessary. exynos_dp_video_phy_pwr_isol() simply does a regmap_update_bits() call now, just call regmap_update_bits() instead and return proper return value. Signed-off-by: Ax

[PATCH RFT] phy: exynos-mipi-video: Use spin_lock to protct state->regmap rmw operations

2015-02-26 Thread Axel Lin
The state->regmap is initialized by devm_regmap_init_mmio(). So it's fine to use spin_lock rather than mutex to protct state->regmap rmw operations. Signed-off-by: Axel Lin --- Hi Sylwester, I don't have this hardware handy, so can you test if this patch works. This patch is on top

[PATCH RFT] phy: exynos-mipi-video: Use spin_lock to protct state-regmap rmw operations

2015-02-26 Thread Axel Lin
The state-regmap is initialized by devm_regmap_init_mmio(). So it's fine to use spin_lock rather than mutex to protct state-regmap rmw operations. Signed-off-by: Axel Lin axel@ingics.com --- Hi Sylwester, I don't have this hardware handy, so can you test if this patch works. This patch

[PATCH] phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function

2015-02-26 Thread Axel Lin
If IS_ERR(state-regs) the .probe fails. So IS_ERR(state-regs) test in exynos_dp_video_phy_pwr_isol() is not necessary. exynos_dp_video_phy_pwr_isol() simply does a regmap_update_bits() call now, just call regmap_update_bits() instead and return proper return value. Signed-off-by: Axel Lin axel

[PATCH] phy: exynos-mipi-video: Fixup the test for state->regmap

2015-02-25 Thread Axel Lin
syscon_regmap_lookup_by_phandle() returns ERR_PTR on error. Thus don't use null test against state->regmap. Signed-off-by: Axel Lin --- drivers/phy/phy-exynos-mipi-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/

[PATCH v2] phy: armada375-usb2: Set drvdata for phy and use it

2015-02-25 Thread Axel Lin
At the context we have pointer to struct phy, it's useful to call phy_get_drvdata() to get the address of cluster_phy. This has slightly better readability than calling dev_get_drvdata(phy->dev.parent). Signed-off-by: Axel Lin --- v2: update commit log drivers/phy/phy-armada375-usb2.c

[PATCH] phy: miphy28lp: Add missing .owner field in miphy28lp_ops

2015-02-25 Thread Axel Lin
Add missing .owner field in miphy28lp_ops, which is used for refcounting. Signed-off-by: Axel Lin --- drivers/phy/phy-miphy28lp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 9b2848e..44e2861 100644 --- a/drivers/phy/phy

[PATCH] phy: xgene: Remove duplicate code to set ctx->dev

2015-02-25 Thread Axel Lin
Set it once is enough and it's done after devm_kzalloc(). Signed-off-by: Axel Lin --- drivers/phy/phy-xgene.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 29214a3..2263cd0 100644 --- a/drivers/phy/phy-xgene.c +++ b/drivers/phy/phy

[PATCH] phy: miphy28lp: Add missing .owner field in miphy28lp_ops

2015-02-25 Thread Axel Lin
Add missing .owner field in miphy28lp_ops, which is used for refcounting. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-miphy28lp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 9b2848e..44e2861 100644

[PATCH] phy: xgene: Remove duplicate code to set ctx-dev

2015-02-25 Thread Axel Lin
Set it once is enough and it's done after devm_kzalloc(). Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-xgene.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 29214a3..2263cd0 100644 --- a/drivers/phy/phy-xgene.c +++ b

[PATCH] phy: exynos-mipi-video: Fixup the test for state-regmap

2015-02-25 Thread Axel Lin
syscon_regmap_lookup_by_phandle() returns ERR_PTR on error. Thus don't use null test against state-regmap. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-exynos-mipi-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-exynos-mipi-video.c

[PATCH v2] phy: armada375-usb2: Set drvdata for phy and use it

2015-02-25 Thread Axel Lin
At the context we have pointer to struct phy, it's useful to call phy_get_drvdata() to get the address of cluster_phy. This has slightly better readability than calling dev_get_drvdata(phy-dev.parent). Signed-off-by: Axel Lin axel@ingics.com --- v2: update commit log drivers/phy/phy

[PATCH] phy: armada375-usb2: Set drvdata for phy and use it

2015-02-24 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/phy/phy-armada375-usb2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c index 7c99ca2..8ccc395 100644 --- a/drivers/phy/phy-armada375-usb2.c +++ b/drivers/phy/phy

Re: [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
2015-02-24 21:47 GMT+08:00 Kishon Vijay Abraham I : > Hi, > > On Tuesday 24 February 2015 05:22 PM, Axel Lin wrote: >> >> Currently, of_get_child_count() is called in each iteration of the for >> loop in >> miphy28lp_xlate(). This patch stores the retu

[PATCH 2/2] phy: miphy365x: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
Currently, of_get_child_count() is called in each iteration of the for loop in miphy365x_xlate(). This patch stores the return value of of_get_child_count() in miphy_dev->nphys and call of_get_child_count() once in miphy365x_probe(). Signed-off-by: Axel Lin --- drivers/phy/phy-miphy365x.c |

[PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
Currently, of_get_child_count() is called in each iteration of the for loop in miphy28lp_xlate(). This patch stores the return value of of_get_child_count() in miphy_dev->nphys and call of_get_child_count() once in miphy28lp_probe(). Signed-off-by: Axel Lin --- drivers/phy/phy-miphy28lp.c |

[PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
Currently, of_get_child_count() is called in each iteration of the for loop in miphy28lp_xlate(). This patch stores the return value of of_get_child_count() in miphy_dev-nphys and call of_get_child_count() once in miphy28lp_probe(). Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy

[PATCH 2/2] phy: miphy365x: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
Currently, of_get_child_count() is called in each iteration of the for loop in miphy365x_xlate(). This patch stores the return value of of_get_child_count() in miphy_dev-nphys and call of_get_child_count() once in miphy365x_probe(). Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy

Re: [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times

2015-02-24 Thread Axel Lin
2015-02-24 21:47 GMT+08:00 Kishon Vijay Abraham I kis...@ti.com: Hi, On Tuesday 24 February 2015 05:22 PM, Axel Lin wrote: Currently, of_get_child_count() is called in each iteration of the for loop in miphy28lp_xlate(). This patch stores the return value of of_get_child_count

[PATCH] phy: armada375-usb2: Set drvdata for phy and use it

2015-02-24 Thread Axel Lin
Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-armada375-usb2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c index 7c99ca2..8ccc395 100644 --- a/drivers/phy/phy-armada375-usb2.c +++ b

[PATCH] mfd: stw481x: Remove unused fields from struct stw481x

2015-02-12 Thread Axel Lin
The mutex lock is not used at all, remove it. The *vmmc_regulator is not necessary, use a local variable in stw481x_vmmc_regulator_probe() instead. Signed-off-by: Axel Lin --- drivers/regulator/stw481x-vmmc.c | 8 include/linux/mfd/stw481x.h | 4 2 files changed, 4 insertions

[PATCH] mfd: stw481x: Remove unused fields from struct stw481x

2015-02-12 Thread Axel Lin
The mutex lock is not used at all, remove it. The *vmmc_regulator is not necessary, use a local variable in stw481x_vmmc_regulator_probe() instead. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/stw481x-vmmc.c | 8 include/linux/mfd/stw481x.h | 4 2 files

[PATCH] regulator: lp872x: Remove **regulators from struct lp872x

2015-01-25 Thread Axel Lin
Current code is using devm_regulator_register(), so we don't need to store *rdev in struct lp872x for clean up. Also clean up lp872x_probe() a bit to remove unnecessary goto and num_regulators variable. Signed-off-by: Axel Lin --- drivers/regulator/lp872x.c | 24 +--- 1 file

[PATCH] regulator: lp872x: Remove **regulators from struct lp872x

2015-01-25 Thread Axel Lin
Current code is using devm_regulator_register(), so we don't need to store *rdev in struct lp872x for clean up. Also clean up lp872x_probe() a bit to remove unnecessary goto and num_regulators variable. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/lp872x.c | 24

[PATCH] regulator: Fix documentation for regmap in the config

2015-01-24 Thread Axel Lin
Signed-off-by: Axel Lin --- include/linux/regulator/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d4ad5b5..045f709 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator

[PATCH] regulator: Fix documentation for regmap in the config

2015-01-24 Thread Axel Lin
Signed-off-by: Axel Lin axel@ingics.com --- include/linux/regulator/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d4ad5b5..045f709 100644 --- a/include/linux/regulator/driver.h +++ b

[PATCH] regulator: qcom_rpm: Don't update vreg->uV/mV if rpm_reg_write fails

2015-01-23 Thread Axel Lin
Ensure get_voltage return correct voltage if set_voltage fails. Signed-off-by: Axel Lin --- drivers/regulator/qcom_rpm-regulator.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c

[PATCH] regulator: qcom_rpm: Don't update vreg-uV/mV if rpm_reg_write fails

2015-01-23 Thread Axel Lin
Ensure get_voltage return correct voltage if set_voltage fails. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/qcom_rpm-regulator.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator

[PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free

2014-10-31 Thread Axel Lin
list_for_each_entry_safe() is necessary if list objects are deleted from the list while traversing it. Signed-off-by: Axel Lin --- drivers/soc/ti/knav_qmss_queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti

[PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free

2014-10-31 Thread Axel Lin
list_for_each_entry_safe() is necessary if list objects are deleted from the list while traversing it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/soc/ti/knav_qmss_queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b

Re: [PATCH] soc: versatile: Add terminating entry for realview_soc_of_match

2014-10-28 Thread Axel Lin
>> >> Arnd are you merging this directly into ARM SoC? >> > > Applied to the fixes branch. Thanks. > > Please remember to add a...@kernel.org when you want us to pick up the > patches. scripts/get_maintainer.pl does not suggest a...@kernel.org for this patch. $ scripts/get_maintainer.pl

Re: [PATCH] soc: versatile: Add terminating entry for realview_soc_of_match

2014-10-28 Thread Axel Lin
Arnd are you merging this directly into ARM SoC? Applied to the fixes branch. Thanks. Please remember to add a...@kernel.org when you want us to pick up the patches. scripts/get_maintainer.pl does not suggest a...@kernel.org for this patch. $ scripts/get_maintainer.pl

[PATCH 3/3] soc: ti: knav_qmss_queue: Return proper error if devm_kzalloc fails

2014-10-26 Thread Axel Lin
Return -ENOMEM if devm_kzalloc fails. Signed-off-by: Axel Lin --- drivers/soc/ti/knav_qmss_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index d66aaf2..6f22d56 100644 --- a/drivers/soc/ti

[PATCH 2/3] soc: ti: knav_qmss_queue: Fix unbalanced locking in knav_pool_create()

2014-10-26 Thread Axel Lin
Don't call mutex_unlock() in the error patch if the mutex_lock() is not called. Signed-off-by: Axel Lin --- drivers/soc/ti/knav_qmss_queue.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index

[PATCH 1/3] soc: ti: Use list_first_entry_or_null() at appropriate places

2014-10-26 Thread Axel Lin
Use list_first_entry_or_null() for first_region() and first_queue_range(). list_first_entry() expects the list is not empty, so first_region() and first_queue_range() never return NULL. Thus use list_first_entry_or_null() instead. Signed-off-by: Axel Lin --- drivers/soc/ti/knav_qmss.h | 8

[PATCH 1/3] soc: ti: Use list_first_entry_or_null() at appropriate places

2014-10-26 Thread Axel Lin
Use list_first_entry_or_null() for first_region() and first_queue_range(). list_first_entry() expects the list is not empty, so first_region() and first_queue_range() never return NULL. Thus use list_first_entry_or_null() instead. Signed-off-by: Axel Lin axel@ingics.com --- drivers/soc/ti

[PATCH 2/3] soc: ti: knav_qmss_queue: Fix unbalanced locking in knav_pool_create()

2014-10-26 Thread Axel Lin
Don't call mutex_unlock() in the error patch if the mutex_lock() is not called. Signed-off-by: Axel Lin axel@ingics.com --- drivers/soc/ti/knav_qmss_queue.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti

[PATCH 3/3] soc: ti: knav_qmss_queue: Return proper error if devm_kzalloc fails

2014-10-26 Thread Axel Lin
Return -ENOMEM if devm_kzalloc fails. Signed-off-by: Axel Lin axel@ingics.com --- drivers/soc/ti/knav_qmss_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index d66aaf2..6f22d56 100644

[PATCH] soc: versatile: Add terminating entry for realview_soc_of_match

2014-10-19 Thread Axel Lin
The of_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin --- drivers/soc/versatile/soc-realview.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index cea8ea3..1a07bf5 100644 --- a/drivers

[PATCH] soc: versatile: Add terminating entry for realview_soc_of_match

2014-10-19 Thread Axel Lin
The of_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin axel@ingics.com --- drivers/soc/versatile/soc-realview.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index cea8ea3..1a07bf5

[PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive

2014-10-09 Thread Axel Lin
Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer. Signed-off-by: Axel Lin --- Hi Mark, I hit below build error and then found this patch is still not yet upstream. So here is a resend. CC [M] drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.o

[PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive

2014-10-09 Thread Axel Lin
Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer. Signed-off-by: Axel Lin axel@ingics.com --- Hi Mark, I hit below build error and then found this patch is still not yet upstream. So here is a resend. CC [M] drivers/gpu/drm/msm/mdp

[PATCH] regulator: sky81452: Remove module version

2014-10-07 Thread Axel Lin
The module version is unlikely to be updated, use kernel version should be enough. Signed-off-by: Axel Lin --- Hi Gyungoh, Seems you have added MODULE_VERSION for the sky81452 serial patches. Do you really need that and will keep updating it? Otherwise, you may want to drop the MODULE_VERSION

[PATCH] regulator: sky81452: Remove module version

2014-10-07 Thread Axel Lin
The module version is unlikely to be updated, use kernel version should be enough. Signed-off-by: Axel Lin axel@ingics.com --- Hi Gyungoh, Seems you have added MODULE_VERSION for the sky81452 serial patches. Do you really need that and will keep updating it? Otherwise, you may want to drop

[PATCH] regulator: qcom_rpm: Fix FORCE_MODE_IS_2_BITS macro

2014-09-24 Thread Axel Lin
Current code does not take the macro parameter, fix it. This is not a problem at this moment because the only user actually passes vreg to FORCE_MODE_IS_2_BITS(). Signed-off-by: Axel Lin --- drivers/regulator/qcom_rpm-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] regulator: qcom_rpm: Don't explicitly initialise the first field of config

2014-09-24 Thread Axel Lin
Doing so generates a warning as the first field is a pointer but we use 0 to initialize it. Signed-off-by: Axel Lin --- drivers/regulator/qcom_rpm-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm

[PATCH] regulator: qcom_rpm: Don't explicitly initialise the first field of config

2014-09-24 Thread Axel Lin
Doing so generates a warning as the first field is a pointer but we use 0 to initialize it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/qcom_rpm-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers

[PATCH] regulator: qcom_rpm: Fix FORCE_MODE_IS_2_BITS macro

2014-09-24 Thread Axel Lin
Current code does not take the macro parameter, fix it. This is not a problem at this moment because the only user actually passes vreg to FORCE_MODE_IS_2_BITS(). Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/qcom_rpm-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] regulator: fan53555: Fix null pointer dereference

2014-09-18 Thread Axel Lin
Set di->regulator before dereference it. Signed-off-by: Axel Lin --- drivers/regulator/fan53555.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index 70b31bf..c82fb9e 100644 --- a/drivers/regulator/fan5355

[PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message

2014-09-18 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/fan53555.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index f2f5535..70b31bf 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c @@ -267,8

[PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message

2014-09-18 Thread Axel Lin
Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/fan53555.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index f2f5535..70b31bf 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator

[PATCH 2/2] regulator: fan53555: Fix null pointer dereference

2014-09-18 Thread Axel Lin
Set di-regulator before dereference it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/fan53555.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index 70b31bf..c82fb9e 100644 --- a/drivers

[RESEND][PATCH v2] regulator: Add stub for devm_regulator_get_exclusive

2014-09-17 Thread Axel Lin
Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer. Signed-off-by: Axel Lin --- Now drivers/gpu/drm/msm/hdmi/hdmi.c is using devm_regulator_get instead of devm_regulator_get_exclusive. commit 3e87599b68e7929a84a32ab65ad17b79a3f271f6 "dr

[RESEND][PATCH v2] regulator: Add stub for devm_regulator_get_exclusive

2014-09-17 Thread Axel Lin
Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer. Signed-off-by: Axel Lin axel@ingics.com --- Now drivers/gpu/drm/msm/hdmi/hdmi.c is using devm_regulator_get instead of devm_regulator_get_exclusive. commit

[PATCH 2/2] regulator: rk808: Fix missing of_node_put

2014-09-11 Thread Axel Lin
reg_np). Signed-off-by: Axel Lin --- drivers/regulator/rk808-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 9557428..07b0eb4 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/d

[PATCH 1/2] regulator: rk808: Remove unused variables

2014-09-11 Thread Axel Lin
Also remove non-informative comment. Signed-off-by: Axel Lin --- drivers/regulator/rk808-regulator.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index d91f2b6..9557428 100644

[PATCH 1/2] regulator: rk808: Remove unused variables

2014-09-11 Thread Axel Lin
Also remove non-informative comment. Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/rk808-regulator.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index d91f2b6

[PATCH 2/2] regulator: rk808: Fix missing of_node_put

2014-09-11 Thread Axel Lin
(reg_np). Signed-off-by: Axel Lin axel@ingics.com --- drivers/regulator/rk808-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 9557428..07b0eb4 100644 --- a/drivers/regulator/rk808

Re: [PATCH] regulator: remove unnecessary of_node_get() to parent

2014-09-10 Thread Axel Lin
2014-09-10 17:23 GMT+08:00 Guodong Xu : > > > On 09/10/2014 12:23 PM, Axel Lin wrote: >> 2014-09-10 12:20 GMT+08:00 Axel Lin : >>> 2014-09-10 11:50 GMT+08:00 Guodong Xu : >>>> These of_node_get() were added to balance refcount decrements inside of >>&

Re: [PATCH] regulator: remove unnecessary of_node_get() to parent

2014-09-10 Thread Axel Lin
2014-09-10 17:23 GMT+08:00 Guodong Xu guodong...@linaro.org: On 09/10/2014 12:23 PM, Axel Lin wrote: 2014-09-10 12:20 GMT+08:00 Axel Lin axel@ingics.com: 2014-09-10 11:50 GMT+08:00 Guodong Xu guodong...@linaro.org: These of_node_get() were added to balance refcount decrements inside

Re: [PATCH] regulator: remove unnecessary of_node_get() to parent

2014-09-09 Thread Axel Lin
2014-09-10 12:20 GMT+08:00 Axel Lin : > 2014-09-10 11:50 GMT+08:00 Guodong Xu : >> These of_node_get() were added to balance refcount decrements inside of >> of_find_node_by_name(). >> See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") >

Re: [PATCH] regulator: remove unnecessary of_node_get() to parent

2014-09-09 Thread Axel Lin
2014-09-10 11:50 GMT+08:00 Guodong Xu : > These of_node_get() were added to balance refcount decrements inside of > of_find_node_by_name(). > See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") > > However of_find_node_by_name() was then replaced by of_get_child_by_name(), > which

[PATCH] regulator: isl9305: REGULATOR_ISL9305 needs to select REGMAP_I2C

2014-09-09 Thread Axel Lin
Fix ERROR: "devm_regmap_init_i2c" [drivers/regulator/isl9305.ko] undefined! Signed-off-by: Axel Lin --- drivers/regulator/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 2b98a34..2419fe4 100644 --- a/drivers

Re: [PATCH] regulator: mc13xxx: add missing of_node_get()

2014-09-09 Thread Axel Lin
2014-09-09 19:07 GMT+08:00 Guodong Xu : > mc13xxx_parse_regulators_dt() goes through dt tree to search for regulator > sub-nodes. For each matched node, later on it will be used and registered > into a regulator_dev. > > of_node_get() should be called to increase its refcount. I think it's done

Re: [PATCH] regulator: mc13xxx: add missing of_node_get()

2014-09-09 Thread Axel Lin
2014-09-09 19:07 GMT+08:00 Guodong Xu guodong...@linaro.org: mc13xxx_parse_regulators_dt() goes through dt tree to search for regulator sub-nodes. For each matched node, later on it will be used and registered into a regulator_dev. of_node_get() should be called to increase its refcount. I

<    2   3   4   5   6   7   8   9   10   11   >