[PATCH RESEND] usb: gadget: f_mass_storage: Fix the logic to iterate all common->luns
It is wrong to do --i in the for loop. Fixes: dd02ea5a3305 ("usb: gadget: mass_storage: Use static array for luns") Signed-off-by: Axel Lin <axel@ingics.com> Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Acked-by: Michal Nazarewicz <min...@mina86.com> --- This patch was sent on https://www.spinics.net/lists/linux-usb/msg157972.html drivers/usb/gadget/function/f_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 74d57d6..5742813 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -2572,7 +2572,7 @@ static int fsg_main_thread(void *common_) int i; down_write(>filesem); - for (i = 0; i < ARRAY_SIZE(common->luns); --i) { + for (i = 0; i < ARRAY_SIZE(common->luns); i++) { struct fsg_lun *curlun = common->luns[i]; if (!curlun || !fsg_lun_is_open(curlun)) continue; -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: gadget: f_mass_storage: Fix the logic to iterate all common->luns
It is wrong to do --i in the for loop. Fixes: dd02ea5a3305 ("usb: gadget: mass_storage: Use static array for luns") Signed-off-by: Axel Lin <axel@ingics.com> --- drivers/usb/gadget/function/f_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 74d57d6..5742813 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -2572,7 +2572,7 @@ static int fsg_main_thread(void *common_) int i; down_write(>filesem); - for (i = 0; i < ARRAY_SIZE(common->luns); --i) { + for (i = 0; i < ARRAY_SIZE(common->luns); i++) { struct fsg_lun *curlun = common->luns[i]; if (!curlun || !fsg_lun_is_open(curlun)) continue; -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND] phy: tusb1210: Use devm_gpiod_get_optional for optional GPIOs
2015-07-15 16:29 GMT+08:00 Uwe Kleine-König u.kleine-koe...@pengutronix.de: Hello, On Wed, Jul 15, 2015 at 01:45:44PM +0530, Kishon Vijay Abraham I wrote: Hi, On Wednesday 15 July 2015 12:34 PM, Axel Lin wrote: 2015-06-20 15:39 GMT+08:00 Axel Lin axel@ingics.com: Also simplify the code a bit by specify direction and initial value for output in devm_gpiod_get_optional function. Signed-off-by: Axel Lin axel@ingics.com Acked-by: Heikki Krogerus heikki.kroge...@linux.intel.com Acked-by: Kishon Vijay Abraham I kis...@ti.com --- Hi This patch was sent on https://lkml.org/lkml/2015/5/31/221 with ACKs. It's still not in linux-next, so here is a resend. Hi Kishon, No response from Felipe. The phy-tusb1210 driver is already in Linus' tree, maybe you can pick up this patch. A similar patch was done by Uwe [1]. But since you've sent this patch before Uwe, IMO your patch must be merged. Uwe, How do you want this patch to be merged. Is it okay If I take this in PHY tree? Can you give your Acked-by? I intend to change the gpiod functions to make the flags mandatory for 4.3. I already sent the respective change to Linus Walleij to pull for next and my commit to fix phy-tusb1210 is included to not break this driver. I'm fine to just apply Uwe's patch if it make things easier. Axel -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] phy: ulpi_phy: Add const qualifier to ops
2015-06-05 8:27 GMT+08:00 Axel Lin axel@ingics.com: The ops is never changed in ulpi_phy_create(), so make it const. Hi Kishon, Would you pick up this patch? Without this patch, passing a const struct phy_ops* to ulip_phy_create will have compiler warning. It should be fine to pass a const struct phy_ops* to ulip_phy_create and since the drivers usually never change phy_ops after initialized, it can be const. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND] phy: tusb1210: Use devm_gpiod_get_optional for optional GPIOs
2015-06-20 15:39 GMT+08:00 Axel Lin axel@ingics.com: Also simplify the code a bit by specify direction and initial value for output in devm_gpiod_get_optional function. Signed-off-by: Axel Lin axel@ingics.com Acked-by: Heikki Krogerus heikki.kroge...@linux.intel.com Acked-by: Kishon Vijay Abraham I kis...@ti.com --- Hi This patch was sent on https://lkml.org/lkml/2015/5/31/221 with ACKs. It's still not in linux-next, so here is a resend. Hi Kishon, No response from Felipe. The phy-tusb1210 driver is already in Linus' tree, maybe you can pick up this patch. Regards, Axel -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND] phy: tusb1210: Use devm_gpiod_get_optional for optional GPIOs
Also simplify the code a bit by specify direction and initial value for output in devm_gpiod_get_optional function. Signed-off-by: Axel Lin axel@ingics.com Acked-by: Heikki Krogerus heikki.kroge...@linux.intel.com Acked-by: Kishon Vijay Abraham I kis...@ti.com --- Hi This patch was sent on https://lkml.org/lkml/2015/5/31/221 with ACKs. It's still not in linux-next, so here is a resend. drivers/phy/phy-tusb1210.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/phy/phy-tusb1210.c b/drivers/phy/phy-tusb1210.c index 07efdd3..e0174da 100644 --- a/drivers/phy/phy-tusb1210.c +++ b/drivers/phy/phy-tusb1210.c @@ -61,32 +61,24 @@ static struct phy_ops phy_ops = { static int tusb1210_probe(struct ulpi *ulpi) { - struct gpio_desc *gpio; struct tusb1210 *tusb; u8 val, reg; - int ret; tusb = devm_kzalloc(ulpi-dev, sizeof(*tusb), GFP_KERNEL); if (!tusb) return -ENOMEM; - gpio = devm_gpiod_get(ulpi-dev, reset); - if (!IS_ERR(gpio)) { - ret = gpiod_direction_output(gpio, 0); - if (ret) - return ret; - gpiod_set_value_cansleep(gpio, 1); - tusb-gpio_reset = gpio; - } + tusb-gpio_reset = devm_gpiod_get_optional(ulpi-dev, reset, + GPIOD_OUT_LOW); + if (IS_ERR(tusb-gpio_reset)) + return PTR_ERR(tusb-gpio_reset); + gpiod_set_value_cansleep(tusb-gpio_reset, 1); - gpio = devm_gpiod_get(ulpi-dev, cs); - if (!IS_ERR(gpio)) { - ret = gpiod_direction_output(gpio, 0); - if (ret) - return ret; - gpiod_set_value_cansleep(gpio, 1); - tusb-gpio_cs = gpio; - } + tusb-gpio_cs = devm_gpiod_get_optional(ulpi-dev, cs, + GPIOD_OUT_LOW); + if (IS_ERR(tusb-gpio_cs)) + return PTR_ERR(tusb-gpio_cs); + gpiod_set_value_cansleep(tusb-gpio_cs, 1); /* * VENDOR_SPECIFIC2 register in TUSB1210 can be used for configuring eye -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in
[PATCH] phy: ulpi_phy: Add const qualifier to ops
The ops is never changed in ulpi_phy_create(), so make it const. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/ulpi_phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/ulpi_phy.h b/drivers/phy/ulpi_phy.h index ac49fb6..f2ebe49 100644 --- a/drivers/phy/ulpi_phy.h +++ b/drivers/phy/ulpi_phy.h @@ -5,7 +5,7 @@ * and it's controller, which is always the parent. */ static inline struct phy -*ulpi_phy_create(struct ulpi *ulpi, struct phy_ops *ops) +*ulpi_phy_create(struct ulpi *ulpi, const struct phy_ops *ops) { struct phy *phy; int ret; -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] usb: phy: Find the right match in devm_usb_phy_match
The res parameter passed to devm_usb_phy_match() is the location where the pointer to the usb_phy is stored, hence it needs to be dereferenced before comparing to the match data in order to find the correct match. Fixes: 410219dcd2ba (usb: otg: utils: devres: Add API's to associate a device with the phy) Signed-off-by: Axel Lin axel@ingics.com Cc: sta...@vger.kernel.org # v3.6+ --- v2: Add Fixes and Cc stable tags drivers/usb/phy/phy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index 2f9735b..d1cd6b5 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -81,7 +81,9 @@ static void devm_usb_phy_release(struct device *dev, void *res) static int devm_usb_phy_match(struct device *dev, void *res, void *match_data) { - return res == match_data; + struct usb_phy **phy = res; + + return *phy == match_data; } /** -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: phy: Find the right match in devm_usb_phy_match
The res parameter passed to devm_usb_phy_match() is the location where the pointer to the usb_phy is stored, hence it needs to be dereferenced before comparing to the match data in order to find the correct match. Signed-off-by: Axel Lin axel@ingics.com --- drivers/usb/phy/phy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index 2f9735b..d1cd6b5 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -81,7 +81,9 @@ static void devm_usb_phy_release(struct device *dev, void *res) static int devm_usb_phy_match(struct device *dev, void *res, void *match_data) { - return res == match_data; + struct usb_phy **phy = res; + + return *phy == match_data; } /** -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] phy: omap-usb2: Fix missing clk_prepare call when using old dt name
Current code does not call clk_prepare(phy-optclk) when using the old usb_otg_ss_refclk960m name. Fix it. Signed-off-by: Axel Lin axel@ingics.com --- drivers/phy/phy-omap-usb2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 6f4aef3..dcdd850 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -296,10 +296,11 @@ static int omap_usb2_probe(struct platform_device *pdev) dev_warn(pdev-dev, found usb_otg_ss_refclk960m, please fix DTS\n); } - } else { - clk_prepare(phy-optclk); } + if (!IS_ERR(phy-optclk)) + clk_prepare(phy-optclk); + usb_add_phy_dev(phy-phy); return 0; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] phy: twl4030-usb: Remove redundant assignment for twl-linkstat
It's pointless to set twl-linkstat twice. Signed-off-by: Axel Lin axel@ingics.com --- Resend with linux-usb in Cc. 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/drivers/phy/phy-twl4030-usb.c @@ -666,7 +666,6 @@ static int twl4030_usb_probe(struct platform_device *pdev) twl-dev= pdev-dev; twl-irq= platform_get_irq(pdev, 0); twl-vbus_supplied = false; - twl-linkstat = -EINVAL; twl-linkstat = OMAP_MUSB_UNKNOWN; twl-phy.dev= twl-dev; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html