Re: [PATCH]sched/rt: Do not try to push tasks if pinned task switches to RT
From: Libo Chen libo.c...@huawei.com On 2013-1-29 4:23, Kirill Tkhai wrote: Just switched pinned task is not able to be pushed. If the rq had had several RT tasks before they have already been considered as candidates to be pushed (or pulled). Signed-off-by: Kirill V Tkhai tk...@yandex.ru CC: Steven Rostedt rost...@goodmis.org CC: Ingo Molnar mi...@kernel.org CC: Peter Zijlstra pet...@infradead.org CC: linux-rt-users linux-rt-us...@vger.kernel.org --- kernel/sched/rt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 4e8f0f4..5f7d92b 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1925,9 +1925,9 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p) */ if (p-on_rq rq-curr != p) { #ifdef CONFIG_SMP - if (rq-rt.overloaded push_rt_task(rq) + if (rq-rt.overloaded p-nr_cpus_allowed 1 /* Don't resched if we changed runqueues */ - rq != task_rq(p)) + push_rt_task(rq) rq != task_rq(p)) I think you worry about it was excess to call push_rt_task, since the task of p-nr_cpus_allowed=1 can`t be pushed. is that right? The task of p-nr_cpus_allowed =1 would`t be added to pushable_tasks list (see the enqueue_task_rt())and this push_rt_task() need to push other tasks when rt.overloaded. So I don`t agree this patch. check_resched = 0; #endif /* CONFIG_SMP */ if (check_resched p-prio rq-curr-prio) -- To unsubscribe from this list: send the line unsubscribe linux-rt-users in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: xilinx: fix memleak
decrease device_node refcount np1 in err case. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c index e90e1f4..64b4639 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c @@ -175,6 +175,7 @@ int axienet_mdio_setup(struct axienet_local *lp, struct device_node *np) printk(KERN_WARNING Setting MDIO clock divisor to default %d\n, DEFAULT_CLOCK_DIVISOR); clk_div = DEFAULT_CLOCK_DIVISOR; + of_node_put(np1); goto issue; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] edac: cell_edac: fix missing of_node_put
decrease device_node refcount np after task completion Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/edac/cell_edac.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c index c2eaf33..493dc30 100644 --- a/drivers/edac/cell_edac.c +++ b/drivers/edac/cell_edac.c @@ -162,6 +162,7 @@ static void cell_edac_init_csrows(struct mem_ctl_info *mci) csrow-first_page, nr_pages); break; } + of_node_put(np); } static int cell_edac_probe(struct platform_device *pdev) -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] power: max8925: fix missing of_node_put
decrease np device_node refcount after task completion Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/power/max8925_power.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c index 0ee1e14..b4513f2 100644 --- a/drivers/power/max8925_power.c +++ b/drivers/power/max8925_power.c @@ -458,6 +458,7 @@ max8925_power_dt_init(struct platform_device *pdev) of_property_read_u32(np, fast-charge, fast_charge); of_property_read_u32(np, no-insert-detect, no_insert_detect); of_property_read_u32(np, no-temp-support, no_temp_support); + of_node_put(np); pdata-batt_detect = batt_detect; pdata-fast_charge = fast_charge; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: ohci-at91: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-at91.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 9677f68..b49a6c8 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -216,8 +216,6 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd, clk_put(fclk); clk_put(iclk); fclk = iclk = hclk = NULL; - - dev_set_drvdata(pdev-dev, NULL); } /*-*/ -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] usb: renesas_usbhs: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/renesas_usbhs/common.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index cfd2050..b097aa3 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -499,7 +499,7 @@ static int usbhs_probe(struct platform_device *pdev) goto probe_end_fifo_exit; /* dev_set_drvdata should be called after usbhs_mod_init */ - dev_set_drvdata(pdev-dev, priv); + platform_set_drvdata(pdev, priv); /* * deviece reset here because -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] usb: r8a66597-hcd: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/r8a66597-hcd.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index a6fd8f5..90a 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -2393,7 +2393,7 @@ static const struct dev_pm_ops r8a66597_dev_pm_ops = { static int r8a66597_remove(struct platform_device *pdev) { - struct r8a66597 *r8a66597 = dev_get_drvdata(pdev-dev); + struct r8a66597 *r8a66597 = platform_get_drvdata(pdev); struct usb_hcd *hcd = r8a66597_to_hcd(r8a66597); del_timer_sync(r8a66597-rh_timer); @@ -2466,7 +2466,7 @@ static int r8a66597_probe(struct platform_device *pdev) } r8a66597 = hcd_to_r8a66597(hcd); memset(r8a66597, 0, sizeof(struct r8a66597)); - dev_set_drvdata(pdev-dev, r8a66597); + platform_set_drvdata(pdev, r8a66597); r8a66597-pdata = pdev-dev.platform_data; r8a66597-irq_sense_low = irq_trigger == IRQF_TRIGGER_LOW; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] usb: phy-tegra-usb: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/phy/phy-tegra-usb.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index cec0855..68bc93f 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -859,7 +859,7 @@ static int tegra_usb_phy_probe(struct platform_device *pdev) tegra_phy-u_phy.shutdown = tegra_usb_phy_close; tegra_phy-u_phy.set_suspend = tegra_usb_phy_suspend; - dev_set_drvdata(pdev-dev, tegra_phy); + platform_set_drvdata(pdev, tegra_phy); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] usb: fotg210-udc: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/gadget/fotg210-udc.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c index 10cd18d..32db2ee 100644 --- a/drivers/usb/gadget/fotg210-udc.c +++ b/drivers/usb/gadget/fotg210-udc.c @@ -1076,7 +1076,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = { static int fotg210_udc_remove(struct platform_device *pdev) { - struct fotg210_udc *fotg210 = dev_get_drvdata(pdev-dev); + struct fotg210_udc *fotg210 = platform_get_drvdata(pdev); usb_del_gadget_udc(fotg210-gadget); iounmap(fotg210-reg); @@ -1134,7 +1134,7 @@ static int fotg210_udc_probe(struct platform_device *pdev) spin_lock_init(fotg210-lock); - dev_set_drvdata(pdev-dev, fotg210); + platform_set_drvdata(pdev, fotg210); fotg210-gadget.ops = fotg210_gadget_ops; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/4] usb: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Libo Chen (4): usb: fotg210-udc: use platform_{get,set}_drvdata() usb: r8a66597-hcd: use platform_{get,set}_drvdata() usb: phy-tegra-usb: use platform_{get,set}_drvdata() usb: renesas_usbhs: use platform_{get,set}_drvdata() drivers/usb/gadget/fotg210-udc.c |4 ++-- drivers/usb/host/r8a66597-hcd.c|4 ++-- drivers/usb/phy/phy-tegra-usb.c|2 +- drivers/usb/renesas_usbhs/common.c |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/4] usb: r8a66597-hcd: use platform_{get,set}_drvdata()
On 2013/8/28 12:36, Greg KH wrote: On Tue, Aug 27, 2013 at 04:10:22PM +0800, Libo Chen wrote: Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/r8a66597-hcd.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) This patch doesn't apply to my tree :( ok, I will rebase on usb-tree later. Thanks, Libo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 1/7] net: fsl_pq_mdio: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fsl_pq_mdio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index c93a056..b7dcd41 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -409,7 +409,7 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) priv-regs = priv-map + data-mii_offset; new_bus-parent = pdev-dev; - dev_set_drvdata(pdev-dev, new_bus); + platform_set_drvdata(pdev, new_bus); if (data-get_tbipa) { for_each_child_of_node(np, tbi) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 3/7] net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index 360a578..eb44797 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -123,8 +123,7 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of) static int mpc52xx_fec_mdio_remove(struct platform_device *of) { - struct device *dev = of-dev; - struct mii_bus *bus = dev_get_drvdata(dev); + struct mii_bus *bus = platform_get_drvdata(of); struct mpc52xx_fec_mdio_priv *priv = bus-priv; mdiobus_unregister(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 5/7] net: sunhme: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunhme.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 171f5b0..b90d311 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3231,7 +3231,7 @@ static int hme_sbus_probe(struct platform_device *op) static int hme_sbus_remove(struct platform_device *op) { - struct happy_meal *hp = dev_get_drvdata(op-dev); + struct happy_meal *hp = platform_get_drvdata(op); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 4/7] net: sunbmac: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunbmac.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c index 0d43fa9..0a32ca5 100644 --- a/drivers/net/ethernet/sun/sunbmac.c +++ b/drivers/net/ethernet/sun/sunbmac.c @@ -1239,7 +1239,7 @@ static int bigmac_sbus_probe(struct platform_device *op) static int bigmac_sbus_remove(struct platform_device *op) { - struct bigmac *bp = dev_get_drvdata(op-dev); + struct bigmac *bp = platform_get_drvdata(op); struct device *parent = op-dev.parent; struct net_device *net_dev = bp-dev; struct platform_device *qec_op; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 7/7] net: davinci_mdio: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com Acked-by: Mugunthan V N mugunthan...@ti.com Acked-by: Lad, Prabhakar prabhakar.cse...@gmail.com --- drivers/net/ethernet/ti/davinci_mdio.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 16ddfc3..01b0cc5 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -421,8 +421,7 @@ bail_out: static int davinci_mdio_remove(struct platform_device *pdev) { - struct device *dev = pdev-dev; - struct davinci_mdio_data *data = dev_get_drvdata(dev); + struct davinci_mdio_data *data = platform_get_drvdata(pdev); if (data-bus) { mdiobus_unregister(data-bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/8] net: ucc_geth: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/ucc_geth.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 533885c..5930c39 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3917,7 +3917,6 @@ static int ucc_geth_remove(struct platform_device* ofdev) unregister_netdev(dev); free_netdev(dev); ucc_geth_memclean(ugeth); - dev_set_drvdata(device, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/8] net: fec_mpc52xx_phy: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index eb44797..e052890 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -127,7 +127,6 @@ static int mpc52xx_fec_mdio_remove(struct platform_device *of) struct mpc52xx_fec_mdio_priv *priv = bus-priv; mdiobus_unregister(bus); - dev_set_drvdata(dev, NULL); iounmap(priv-regs); kfree(priv); mdiobus_free(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/8] net: fsl_pq_mdio: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fsl_pq_mdio.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index b7dcd41..c4f6506 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -468,8 +468,6 @@ static int fsl_pq_mdio_remove(struct platform_device *pdev) mdiobus_unregister(bus); - dev_set_drvdata(device, NULL); - iounmap(priv-map); mdiobus_free(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 6/8] net: xilinx_emaclite: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/xilinx/xilinx_emaclite.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 7c1ccbc..4c619ea 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1249,7 +1249,6 @@ static int xemaclite_of_remove(struct platform_device *of_dev) lp-phy_node = NULL; xemaclite_remove_ndev(ndev, of_dev); - dev_set_drvdata(dev, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/8] net: sunbmac: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunbmac.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c index 0a32ca5..7217ee5 100644 --- a/drivers/net/ethernet/sun/sunbmac.c +++ b/drivers/net/ethernet/sun/sunbmac.c @@ -1259,8 +1259,6 @@ static int bigmac_sbus_remove(struct platform_device *op) free_netdev(net_dev); - dev_set_drvdata(op-dev, NULL); - return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/8] net: sunhme: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunhme.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index b90d311..c67e683 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3250,8 +3250,6 @@ static int hme_sbus_remove(struct platform_device *op) free_netdev(net_dev); - dev_set_drvdata(op-dev, NULL); - return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 8/8] net: emac: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/ibm/emac/core.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index d300a0c..2d3b064 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c @@ -2955,8 +2955,6 @@ static int emac_remove(struct platform_device *ofdev) DBG(dev, remove NL); - dev_set_drvdata(ofdev-dev, NULL); - unregister_netdev(dev-ndev); cancel_work_sync(dev-reset_work); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 7/8] net: davinci_mdio: remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/ti/davinci_mdio.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 01b0cc5..7f85143 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -433,8 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev) pm_runtime_put_sync(pdev-dev); pm_runtime_disable(pdev-dev); - dev_set_drvdata(dev, NULL); - kfree(data); return 0; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/2] net: can: use platform_set_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_set_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Libo Chen (2): net: can: at91_can: use platform_set_drvdata() net: can: flexcan: use platform_set_drvdata() drivers/net/can/at91_can.c |2 +- drivers/net/can/flexcan.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] net: can: flexcan: use platform_set_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_set_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/can/flexcan.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 7b0be09..9978de7 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1087,7 +1087,7 @@ static int flexcan_probe(struct platform_device *pdev) netif_napi_add(dev, priv-napi, flexcan_poll, FLEXCAN_NAPI_WEIGHT); - dev_set_drvdata(pdev-dev, dev); + platform_set_drvdata(pdev, dev); SET_NETDEV_DEV(dev, pdev-dev); err = register_flexcandev(dev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: phy: mdio-octeon: use platform_set_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_set_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/phy/mdio-octeon.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c index b51fa1f..7f18f80 100644 --- a/drivers/net/phy/mdio-octeon.c +++ b/drivers/net/phy/mdio-octeon.c @@ -222,7 +222,7 @@ static int octeon_mdiobus_probe(struct platform_device *pdev) bus-mii_bus-read = octeon_mdiobus_read; bus-mii_bus-write = octeon_mdiobus_write; - dev_set_drvdata(pdev-dev, bus); + platform_set_drvdata(pdev, bus); err = of_mdiobus_register(bus-mii_bus, pdev-dev.of_node); if (err) -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net: irda: pxaficp_ir: use platform_set_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using deva_set_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/irda/pxaficp_ir.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index 964b116..3eeaaf8 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c @@ -915,7 +915,7 @@ static int pxa_irda_probe(struct platform_device *pdev) err = register_netdev(dev); if (err == 0) - dev_set_drvdata(pdev-dev, dev); + platform_set_drvdata(pdev, dev); if (err) { if (si-pdata-shutdown) -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] net: can: at91_can: use platform_set_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_set_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/can/at91_can.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index dbbe97a..3b1ff61 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -1355,7 +1355,7 @@ static int at91_can_probe(struct platform_device *pdev) if (at91_is_sam9263(priv)) dev-sysfs_groups[0] = at91_sysfs_attr_group; - dev_set_drvdata(pdev-dev, dev); + platform_set_drvdata(pdev, dev); SET_NETDEV_DEV(dev, pdev-dev); err = register_candev(dev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] iommu: remove unnecessary platform_set_drvdata()
On 2013/8/22 9:53, Jingoo Han wrote: The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han jg1@samsung.com --- It looks good. Acked-by: Libo Chen libo.c...@huawei.com drivers/iommu/msm_iommu_dev.c |2 -- drivers/iommu/omap-iommu.c|2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c index 0a1c962..08ba497 100644 --- a/drivers/iommu/msm_iommu_dev.c +++ b/drivers/iommu/msm_iommu_dev.c @@ -282,7 +282,6 @@ static int msm_iommu_remove(struct platform_device *pdev) clk_put(drv-pclk); memset(drv, 0, sizeof(*drv)); kfree(drv); - platform_set_drvdata(pdev, NULL); } return 0; } @@ -366,7 +365,6 @@ static int msm_iommu_ctx_remove(struct platform_device *pdev) if (drv) { memset(drv, 0, sizeof(struct msm_iommu_ctx_drvdata)); kfree(drv); - platform_set_drvdata(pdev, NULL); } return 0; } diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 0ba3766..bcd78a7 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1008,8 +1008,6 @@ static int omap_iommu_remove(struct platform_device *pdev) struct resource *res; struct omap_iommu *obj = platform_get_drvdata(pdev); - platform_set_drvdata(pdev, NULL); - iopgtable_clear_entry_all(obj); irq = platform_get_irq(pdev, 0); -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 0/8] use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. changelog: this version add modify record about dev_set_drvdata(). Libo Chen (8): net: fsl_pq_mdio: use platform_{get,set}_drvdata() net: ucc_geth: use platform_{get,set}_drvdata() net: fec_mpc52xx_phy: use platform_{get,set}_drvdata() net: fs_enet: remove unnecessary dev_set_drvdata() net: sunbmac: use platform_{get,set}_drvdata() net: sunhme: use platform_{get,set}_drvdata() net: xilinx_emaclite: use platform_{get,set}_drvdata() net: davinci_mdio: use platform_{get,set}_drvdata() drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |4 +--- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |1 - drivers/net/ethernet/freescale/fsl_pq_mdio.c |3 +-- drivers/net/ethernet/freescale/ucc_geth.c |4 +--- drivers/net/ethernet/sun/sunbmac.c |3 +-- drivers/net/ethernet/sun/sunhme.c |8 +++- drivers/net/ethernet/ti/davinci_mdio.c |4 +--- drivers/net/ethernet/xilinx/xilinx_emaclite.c |4 +--- 8 files changed, 9 insertions(+), 22 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 2/8] net: ucc_geth: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with ofdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/ucc_geth.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 3c43dac..5930c39 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3911,14 +3911,12 @@ static int ucc_geth_probe(struct platform_device* ofdev) static int ucc_geth_remove(struct platform_device* ofdev) { - struct device *device = ofdev-dev; - struct net_device *dev = dev_get_drvdata(device); + struct net_device *dev = platform_get_drvdata(ofdev); struct ucc_geth_private *ugeth = netdev_priv(dev); unregister_netdev(dev); free_netdev(dev); ucc_geth_memclean(ugeth); - dev_set_drvdata(device, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 3/8] net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with of-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index 360a578..e052890 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -123,12 +123,10 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of) static int mpc52xx_fec_mdio_remove(struct platform_device *of) { - struct device *dev = of-dev; - struct mii_bus *bus = dev_get_drvdata(dev); + struct mii_bus *bus = platform_get_drvdata(of); struct mpc52xx_fec_mdio_priv *priv = bus-priv; mdiobus_unregister(bus); - dev_set_drvdata(dev, NULL); iounmap(priv-regs); kfree(priv); mdiobus_free(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 4/8] net: fs_enet: remove unnecessary dev_set_drvdata()
unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 8de53a1..7e3de10 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -1122,7 +1122,6 @@ static int fs_enet_remove(struct platform_device *ofdev) fep-ops-free_bd(ndev); fep-ops-cleanup_data(ndev); - dev_set_drvdata(fep-dev, NULL); of_node_put(fep-fpi-phy_node); free_netdev(ndev); return 0; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 6/8] net: sunhme: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunhme.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 171f5b0..a111f29 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3111,7 +3111,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out_iounmap; } - dev_set_drvdata(pdev-dev, hp); + platform_set_drvdata(pdev, hp); if (!qfe_slot) { struct pci_dev *qpdev = qp-quattro_dev; @@ -3159,7 +3159,7 @@ err_out: static void happy_meal_pci_remove(struct pci_dev *pdev) { - struct happy_meal *hp = dev_get_drvdata(pdev-dev); + struct happy_meal *hp = platform_get_drvdata(pdev); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); @@ -3171,7 +3171,6 @@ static void happy_meal_pci_remove(struct pci_dev *pdev) free_netdev(net_dev); - dev_set_drvdata(pdev-dev, NULL); } static DEFINE_PCI_DEVICE_TABLE(happymeal_pci_ids) = { @@ -3231,7 +3230,7 @@ static int hme_sbus_probe(struct platform_device *op) static int hme_sbus_remove(struct platform_device *op) { - struct happy_meal *hp = dev_get_drvdata(op-dev); + struct happy_meal *hp = platform_get_drvdata(op); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); @@ -3250,7 +3249,6 @@ static int hme_sbus_remove(struct platform_device *op) free_netdev(net_dev); - dev_set_drvdata(op-dev, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 5/8] net: sunbmac: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with of-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunbmac.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c index 0d43fa9..34b94cc 100644 --- a/drivers/net/ethernet/sun/sunbmac.c +++ b/drivers/net/ethernet/sun/sunbmac.c @@ -1239,7 +1239,7 @@ static int bigmac_sbus_probe(struct platform_device *op) static int bigmac_sbus_remove(struct platform_device *op) { - struct bigmac *bp = dev_get_drvdata(op-dev); + struct bigmac *bp = platform_get_drvdata(op); struct device *parent = op-dev.parent; struct net_device *net_dev = bp-dev; struct platform_device *qec_op; @@ -1259,7 +1259,6 @@ static int bigmac_sbus_remove(struct platform_device *op) free_netdev(net_dev); - dev_set_drvdata(op-dev, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 8/8] net: davinci_mdio: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/ti/davinci_mdio.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 16ddfc3..2249b2c 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -421,8 +421,7 @@ bail_out: static int davinci_mdio_remove(struct platform_device *pdev) { - struct device *dev = pdev-dev; - struct davinci_mdio_data *data = dev_get_drvdata(dev); + struct davinci_mdio_data *data = platform_get_drvdata(pdev); if (data-bus) { mdiobus_unregister(data-bus); @@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev) pm_runtime_put_sync(pdev-dev); pm_runtime_disable(pdev-dev); - dev_set_drvdata(dev, NULL); kfree(data); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 7/8] net: xilinx_emaclite: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with of_dev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/xilinx/xilinx_emaclite.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index fd4dbda..4c619ea 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1230,8 +1230,7 @@ error: */ static int xemaclite_of_remove(struct platform_device *of_dev) { - struct device *dev = of_dev-dev; - struct net_device *ndev = dev_get_drvdata(dev); + struct net_device *ndev = platform_get_drvdata(of_dev); struct net_local *lp = netdev_priv(ndev); @@ -1250,7 +1249,6 @@ static int xemaclite_of_remove(struct platform_device *of_dev) lp-phy_node = NULL; xemaclite_remove_ndev(ndev, of_dev); - dev_set_drvdata(dev, NULL); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 1/8] net: fsl_pq_mdio: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fsl_pq_mdio.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index c93a056..995a3ab 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -409,7 +409,7 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) priv-regs = priv-map + data-mii_offset; new_bus-parent = pdev-dev; - dev_set_drvdata(pdev-dev, new_bus); + platform_set_drvdata(pdev, new_bus); if (data-get_tbipa) { for_each_child_of_node(np, tbi) { @@ -468,7 +468,6 @@ static int fsl_pq_mdio_remove(struct platform_device *pdev) mdiobus_unregister(bus); - dev_set_drvdata(device, NULL); iounmap(priv-map); mdiobus_free(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND 1/8] net: fsl_pq_mdio: use platform_{get,set}_drvdata()
On 2013/8/15 2:54, Sergei Shtylyov wrote: Hello. On 08/14/2013 07:39 AM, Libo Chen wrote: We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. You misunderstood. That's a material for 2 separate patch sets (or maybe single patches, since multiple files can be collapsed in a single patch). okay, thanks. Libo Signed-off-by: Libo Chen libo.c...@huawei.com WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 4/7] net: sunbmac: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with op-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunbmac.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c index 0d43fa9..0a32ca5 100644 --- a/drivers/net/ethernet/sun/sunbmac.c +++ b/drivers/net/ethernet/sun/sunbmac.c @@ -1239,7 +1239,7 @@ static int bigmac_sbus_probe(struct platform_device *op) static int bigmac_sbus_remove(struct platform_device *op) { - struct bigmac *bp = dev_get_drvdata(op-dev); + struct bigmac *bp = platform_get_drvdata(op); struct device *parent = op-dev.parent; struct net_device *net_dev = bp-dev; struct platform_device *qec_op; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/7] net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index 360a578..eb44797 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -123,8 +123,7 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of) static int mpc52xx_fec_mdio_remove(struct platform_device *of) { - struct device *dev = of-dev; - struct mii_bus *bus = dev_get_drvdata(dev); + struct mii_bus *bus = platform_get_drvdata(of); struct mpc52xx_fec_mdio_priv *priv = bus-priv; mdiobus_unregister(bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/7] net: fsl_pq_mdio: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/freescale/fsl_pq_mdio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index c93a056..b7dcd41 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -409,7 +409,7 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) priv-regs = priv-map + data-mii_offset; new_bus-parent = pdev-dev; - dev_set_drvdata(pdev-dev, new_bus); + platform_set_drvdata(pdev, new_bus); if (data-get_tbipa) { for_each_child_of_node(np, tbi) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 7/7] net: davinci_mdio: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/ti/davinci_mdio.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 16ddfc3..01b0cc5 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -421,8 +421,7 @@ bail_out: static int davinci_mdio_remove(struct platform_device *pdev) { - struct device *dev = pdev-dev; - struct davinci_mdio_data *data = dev_get_drvdata(dev); + struct davinci_mdio_data *data = platform_get_drvdata(pdev); if (data-bus) { mdiobus_unregister(data-bus); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 6/7] net: xilinx_emaclite: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of_dev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/xilinx/xilinx_emaclite.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index fd4dbda..7c1ccbc 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1230,8 +1230,7 @@ error: */ static int xemaclite_of_remove(struct platform_device *of_dev) { - struct device *dev = of_dev-dev; - struct net_device *ndev = dev_get_drvdata(dev); + struct net_device *ndev = platform_get_drvdata(of_dev); struct net_local *lp = netdev_priv(ndev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 5/7] net: sunhme: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunhme.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 171f5b0..4900ea8 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3111,7 +3111,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out_iounmap; } - dev_set_drvdata(pdev-dev, hp); + platform_set_drvdata(pdev, hp); if (!qfe_slot) { struct pci_dev *qpdev = qp-quattro_dev; @@ -3159,7 +3159,7 @@ err_out: static void happy_meal_pci_remove(struct pci_dev *pdev) { - struct happy_meal *hp = dev_get_drvdata(pdev-dev); + struct happy_meal *hp = platform_get_drvdata(pdev); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); @@ -3231,7 +3231,7 @@ static int hme_sbus_probe(struct platform_device *op) static int hme_sbus_remove(struct platform_device *op) { - struct happy_meal *hp = dev_get_drvdata(op-dev); + struct happy_meal *hp = platform_get_drvdata(op); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 6/7] net: xilinx_emaclite: use platform_{get,set}_drvdata()
On 2013/8/16 6:23, David Miller wrote: From: Libo Chen clbchenlibo.c...@huawei.com Date: Thu, 15 Aug 2013 21:01:47 +0800 Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of_dev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com Why did you not CC: netdev on this patch? oh, my script doesn`t work well! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 RESEND 5/7] net: sunhme: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with of_dev-dev, so we can directly pass a struct platform_device. changelog: remove modify about happy_meal_pci_probe happy_meal_pci_remove Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/sun/sunhme.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 171f5b0..b90d311 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3231,7 +3231,7 @@ static int hme_sbus_probe(struct platform_device *op) static int hme_sbus_remove(struct platform_device *op) { - struct happy_meal *hp = dev_get_drvdata(op-dev); + struct happy_meal *hp = platform_get_drvdata(op); struct net_device *net_dev = hp-dev; unregister_netdev(net_dev); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Q: use vlan in container
Hello LXC experts, I meet a problem. When using vlan as network device in suse11 system container, I can not use halt to stop this container. It hung on eth0 is still used from interfaces eth0 in cycle. The config file: lxc.network.type = vlan lxc.network.flags = up lxc.network.link = eth0 lxc.network.name = eth0 lxc.network.vlan.id = 1301 lxc.network.ipv4 = 128.5.131.100/24 The reason is in the shell command /sbin/ifdown, see below: ## # Shut down depending interfaces # # Check if there are interfaces which depend on this interface. If yes these # have to be shut down first. # For example these might be bonding or vlan interfaces. Note that we don't # catch all types of depending interfaces currently. See function # 'get_depending_ifaces' in file 'functions' for details. # test $SCRIPTNAME = ifdown DEP_IFACES=`get_depending_ifaces $INTERFACE` if [ $? = 0 -a $NODEPS != yes ] ; then message `printf %-9s is still used from interfaces %s \ $INTERFACE $DEP_IFACES` for DI in $DEP_IFACES; do ifdown $DI -o $OPTIONS done message `printf %-9s now going down itself $INTERFACE` # check if iface is (still) avaliable # [bonding master may go down itself # while the last slave gets removed] if ! is_iface_available $INTERFACE; then exit $R_SUCCESS fi fi $DEP_IFACES is also eth0 in this scene, so ifdown will call ifdown again and again. if we set lxc.network.name = eth1, it will be ok, so can we add a judgment to make lxc.network.link and lxc.network.name are not equal in lxc-start command. simple implement like: if [ lxc.network.type == vlan ] ; then if [ lxc.network.link == lxc.network.name ] ; then return false fi fi Is it reasonable? or any other way to achieve this? -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Q: use vlan in container
On 2013/11/29 13:05, Serge Hallyn wrote: Quoting Libo Chen (clbchenlibo.c...@huawei.com): Hello LXC experts, I meet a problem. When using vlan as network device in suse11 system container, I can not use halt to stop this container. It hung on eth0 is still used from interfaces eth0 in cycle. The config file: lxc.network.type = vlan lxc.network.flags = up lxc.network.link = eth0 lxc.network.name = eth0 lxc.network.vlan.id = 1301 lxc.network.ipv4 = 128.5.131.100/24 The reason is in the shell command /sbin/ifdown, see below: ## # Shut down depending interfaces # # Check if there are interfaces which depend on this interface. If yes these # have to be shut down first. # For example these might be bonding or vlan interfaces. Note that we don't # catch all types of depending interfaces currently. See function # 'get_depending_ifaces' in file 'functions' for details. # test $SCRIPTNAME = ifdown DEP_IFACES=`get_depending_ifaces $INTERFACE` if [ $? = 0 -a $NODEPS != yes ] ; then message `printf %-9s is still used from interfaces %s \ $INTERFACE $DEP_IFACES` for DI in $DEP_IFACES; do Should the proper fix be to fix this script so that it doesn't call ifdown recursively if $DI = $INTERFACE ? Hi Serge, yes, I had try this way before as below: for DI in $DEP_IFACES; do if [ $DI != $INTERFACE ] ; then ifdown $DI -o $OPTIONS fi done It works well, but I have no idea it is safe enough and no side effects? Thanks, Libo ifdown $DI -o $OPTIONS done message `printf %-9s now going down itself $INTERFACE` # check if iface is (still) avaliable # [bonding master may go down itself # while the last slave gets removed] if ! is_iface_available $INTERFACE; then exit $R_SUCCESS fi fi $DEP_IFACES is also eth0 in this scene, so ifdown will call ifdown again and again. if we set lxc.network.name = eth1, it will be ok, so can we add a judgment to make lxc.network.link and lxc.network.name are not equal in lxc-start command. simple implement like: if [ lxc.network.type == vlan ] ; then if [ lxc.network.link == lxc.network.name ] ; then return false fi fi Is it reasonable? or any other way to achieve this? . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Q: use vlan in container
On 2013/11/29 22:18, Serge Hallyn wrote: Quoting Libo Chen (clbchenlibo.c...@huawei.com): On 2013/11/29 13:05, Serge Hallyn wrote: Quoting Libo Chen (clbchenlibo.c...@huawei.com): Hello LXC experts, I meet a problem. When using vlan as network device in suse11 system container, I can not use halt to stop this container. It hung on eth0 is still used from interfaces eth0 in cycle. The config file: lxc.network.type = vlan lxc.network.flags = up lxc.network.link = eth0 lxc.network.name = eth0 lxc.network.vlan.id = 1301 lxc.network.ipv4 = 128.5.131.100/24 The reason is in the shell command /sbin/ifdown, see below: ## # Shut down depending interfaces # # Check if there are interfaces which depend on this interface. If yes these # have to be shut down first. # For example these might be bonding or vlan interfaces. Note that we don't # catch all types of depending interfaces currently. See function # 'get_depending_ifaces' in file 'functions' for details. # test $SCRIPTNAME = ifdown DEP_IFACES=`get_depending_ifaces $INTERFACE` if [ $? = 0 -a $NODEPS != yes ] ; then message `printf %-9s is still used from interfaces %s \ $INTERFACE $DEP_IFACES` for DI in $DEP_IFACES; do Should the proper fix be to fix this script so that it doesn't call ifdown recursively if $DI = $INTERFACE ? Hi Serge, yes, I had try this way before as below: for DI in $DEP_IFACES; do if [ $DI != $INTERFACE ] ; then ifdown $DI -o $OPTIONS fi done It works well, but I have no idea it is safe enough and no side effects? It's safe enough and should have no side effects itself. But I recommend you first look up how get_depending_ifaces() is implemented. That's where this really should be fixed, and if it turns out that the proper fix for *that* is in the kernel then that's ok. thank you for your suggestion. Libo -serge . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/2] i2c: fix two wrong mem release
fix two wrong mem release Libo Chen (2): i2c: i2c-bfin-twi:don`t free peripheral before it`s init successful i2c: pxa: no need release_mem_region before request_mem_region successful drivers/i2c/busses/i2c-bfin-twi.c |2 +- drivers/i2c/busses/i2c-pxa.c |5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] i2c: pxa: no need release_mem_region before request_mem_region successful
move release_mem_region above kfree(i2c) below clk_put(i2c-clk) Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-pxa.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index ea6d45d..3188cd0 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1129,7 +1129,7 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c-clk = clk_get(dev-dev, NULL); if (IS_ERR(i2c-clk)) { ret = PTR_ERR(i2c-clk); - goto eclk; + goto emm; } i2c-reg_base = ioremap(res-start, resource_size(res)); @@ -1206,10 +1206,11 @@ ereqirq: iounmap(i2c-reg_base); eremap: clk_put(i2c-clk); +emm: + release_mem_region(res-start, resource_size(res)); eclk: kfree(i2c); emalloc: - release_mem_region(res-start, resource_size(res)); return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] i2c: i2c-bfin-twi: don`t free peripheral before it`s init successful
down out_error_no_irq. When platform_get_irq fail, no need to free peripheral Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-bfin-twi.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 05080c4..d38e05a 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c @@ -709,8 +709,8 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev) out_error_add_adapter: free_irq(iface-irq, iface); out_error_req_irq: -out_error_no_irq: peripheral_free_list((unsigned short *)pdev-dev.platform_data); +out_error_no_irq: out_error_pin_mux: iounmap(iface-regs_base); out_error_ioremap: -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] i2c: pxa: no need release_mem_region before request_mem_region successful
On 2013/5/7 10:59, Gu Zheng wrote: Hi libo, On 05/06/2013 09:11 PM, Libo Chen wrote: move release_mem_region above kfree(i2c) below clk_put(i2c-clk) Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-pxa.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index ea6d45d..3188cd0 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1129,7 +1129,7 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c-clk = clk_get(dev-dev, NULL); if (IS_ERR(i2c-clk)) { ret = PTR_ERR(i2c-clk); -goto eclk; +goto emm; The new tag 'emm' seems not suitable here, keep the original 'eclk' here, modify the upper 'eclk' tags instead: ... ret = i2c_pxa_probe_dt(dev, i2c, i2c_type); if (ret 0) ret = i2c_pxa_probe_pdata(dev, i2c, i2c_type); if (ret 0) - goto eclk; + goto etype; res = platform_get_resource(dev, IORESOURCE_MEM, 0); irq = platform_get_irq(dev, 0); if (res == NULL || irq 0) { ret = -ENODEV; - goto eclk; + goto edev; Thanks a lot. Yes, it is . Original lable name seems not suitable. but lable:edev is redundant, useless . I concern this patch is usefull for your work? However I will change it later. Thanks, Libo } if (!request_mem_region(res-start, resource_size(res), res-name)) { ret = -ENOMEM; - goto eclk; + goto emem; } ... } i2c-reg_base = ioremap(res-start, resource_size(res)); @@ -1206,10 +1206,11 @@ ereqirq: iounmap(i2c-reg_base); eremap: clk_put(i2c-clk); +emm: +release_mem_region(res-start, resource_size(res)); eclk: kfree(i2c); eclk: release_mem_region(res-start, resource_size(res)); etype: edev: emem: kfree(i2c); emalloc: -release_mem_region(res-start, resource_size(res)); return ret; } Thanks, Gu . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/4] usb: fix four memleak
fix four goto wrong tag, avoid memleak Libo Chen (4): usb: ehci-s5p: fix memleak when fallback to pdata usb: isp1760-if: fix memleak when platform_get_resource fail usb: ohci: fix goto wrong tag in err case usb: tilegx: fix memleak when create hcd fail drivers/usb/host/ehci-s5p.c|1 + drivers/usb/host/isp1760-if.c |4 +++- drivers/usb/host/ohci-nxp.c| 12 ++-- drivers/usb/host/ohci-tilegx.c |7 +-- 4 files changed, 15 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] usb: tilegx: fix memleak when create hcd fail
From: Libo Chen chenlib...@gmail.com When usb_create_hcd fail, we should call gxio_usb_host_destroy Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-tilegx.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-tilegx.c b/drivers/usb/host/ohci-tilegx.c index 1ae7b28..5888fc4 100644 --- a/drivers/usb/host/ohci-tilegx.c +++ b/drivers/usb/host/ohci-tilegx.c @@ -112,8 +112,10 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev) hcd = usb_create_hcd(ohci_tilegx_hc_driver, pdev-dev, dev_name(pdev-dev)); - if (!hcd) - return -ENOMEM; + if (!hcd){ + ret = -ENOMEM; + goto err_hcd; + } /* * We don't use rsrc_start to map in our registers, but seems like @@ -165,6 +167,7 @@ err_have_irq: err_no_irq: tilegx_stop_ohc(); usb_put_hcd(hcd); +err_hcd: gxio_usb_host_destroy(pdata-usb_ctx); return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] usb: isp1760-if: fix memleak when platform_get_resource fail
From: Libo Chen chenlib...@gmail.com When platform_get_resource fail, we should release_mem_region Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/isp1760-if.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index bbb791b..a13709e 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -373,8 +373,10 @@ static int isp1760_plat_probe(struct platform_device *pdev) irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq_res) { pr_warning(isp1760: IRQ resource not available\n); - return -ENODEV; + ret = -ENODEV; + goto cleanup; } + irqflags |= irq_res-flags IRQF_TRIGGER_MASK; if (priv) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] usb: ehci-s5p: fix memleak when fallback to pdata
From: Libo Chen chenlib...@gmail.com When devm_usb_get_phy fail, we should free hcd Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ehci-s5p.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 6357752..3fbab58 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -107,6 +107,7 @@ static int s5p_ehci_probe(struct platform_device *pdev) if (IS_ERR(phy)) { /* Fallback to pdata */ if (!pdata) { + usb_put_hcd(hcd); dev_warn(pdev-dev, no platform data or transceiver defined\n); return -EPROBE_DEFER; } else { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] usb: ohci: fix goto wrong tag in err case
From: Libo Chen chenlib...@gmail.com fix goto wrong tag in usb_hcd_nxp_probe Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-nxp.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index f4988fb..eb294a9 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -234,7 +234,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (usb_disabled()) { dev_err(pdev-dev, USB is disabled\n); ret = -ENODEV; - goto out; + goto out1; } /* Enable AHB slave USB clock, needed for further USB clock control */ @@ -265,13 +265,13 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (IS_ERR(usb_dev_clk)) { dev_err(pdev-dev, failed to acquire USB DEV Clock\n); ret = PTR_ERR(usb_dev_clk); - goto out4; + goto out3; } ret = clk_enable(usb_dev_clk); if (ret 0) { dev_err(pdev-dev, failed to start USB DEV Clock\n); - goto out5; + goto out4; } /* Enable USB otg clocks */ @@ -279,7 +279,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (IS_ERR(usb_otg_clk)) { dev_err(pdev-dev, failed to acquire USB DEV Clock\n); ret = PTR_ERR(usb_otg_clk); - goto out6; + goto out5; } __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); @@ -287,7 +287,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) ret = clk_enable(usb_otg_clk); if (ret 0) { dev_err(pdev-dev, failed to start USB DEV Clock\n); - goto out7; + goto out6; } isp1301_configure(); @@ -296,7 +296,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (!hcd) { dev_err(pdev-dev, Failed to allocate HC buffer\n); ret = -ENOMEM; - goto out8; + goto out7; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 3/4] usb: ohci: fix goto wrong tag in err case
fix goto wrong tag in usb_hcd_nxp_probe Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-nxp.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index f4988fb..eb294a9 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -234,7 +234,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (usb_disabled()) { dev_err(pdev-dev, USB is disabled\n); ret = -ENODEV; - goto out; + goto out1; } /* Enable AHB slave USB clock, needed for further USB clock control */ @@ -265,13 +265,13 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (IS_ERR(usb_dev_clk)) { dev_err(pdev-dev, failed to acquire USB DEV Clock\n); ret = PTR_ERR(usb_dev_clk); - goto out4; + goto out3; } ret = clk_enable(usb_dev_clk); if (ret 0) { dev_err(pdev-dev, failed to start USB DEV Clock\n); - goto out5; + goto out4; } /* Enable USB otg clocks */ @@ -279,7 +279,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (IS_ERR(usb_otg_clk)) { dev_err(pdev-dev, failed to acquire USB DEV Clock\n); ret = PTR_ERR(usb_otg_clk); - goto out6; + goto out5; } __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); @@ -287,7 +287,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) ret = clk_enable(usb_otg_clk); if (ret 0) { dev_err(pdev-dev, failed to start USB DEV Clock\n); - goto out7; + goto out6; } isp1301_configure(); @@ -296,7 +296,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) if (!hcd) { dev_err(pdev-dev, Failed to allocate HC buffer\n); ret = -ENOMEM; - goto out8; + goto out7; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 1/4] usb: ehci-s5p: fix memleak when devm_usb_get_phy fail
When devm_usb_get_phy fail, we should free hcd Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ehci-s5p.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 6357752..3fbab58 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -107,6 +107,7 @@ static int s5p_ehci_probe(struct platform_device *pdev) if (IS_ERR(phy)) { /* Fallback to pdata */ if (!pdata) { + usb_put_hcd(hcd); dev_warn(pdev-dev, no platform data or transceiver defined\n); return -EPROBE_DEFER; } else { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 2/4] usb: isp1760-if: fix memleak when platform_get_resource fail
When platform_get_resource fail, we should release_mem_region Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/isp1760-if.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index bbb791b..a13709e 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -373,8 +373,10 @@ static int isp1760_plat_probe(struct platform_device *pdev) irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq_res) { pr_warning(isp1760: IRQ resource not available\n); - return -ENODEV; + ret = -ENODEV; + goto cleanup; } + irqflags |= irq_res-flags IRQF_TRIGGER_MASK; if (priv) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 0/4] usb: fix four memleak
change address from Libo Chen chenlib...@gmail.com to Libo Chen libo.c...@huawei.com fix four goto wrong tag, avoid memleak Libo Chen (4): usb: ehci-s5p: fix memleak when devm_usb_get_phy fail usb: isp1760-if: fix memleak when platform_get_resource fail usb: ohci: fix goto wrong tag in err case usb: tilegx: fix memleak when create hcd fail drivers/usb/host/ehci-s5p.c|1 + drivers/usb/host/isp1760-if.c |4 +++- drivers/usb/host/ohci-nxp.c| 12 ++-- drivers/usb/host/ohci-tilegx.c |7 +-- 4 files changed, 15 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 4/4] usb: tilegx: fix memleak when create hcd fail
When usb_create_hcd fail, we should call gxio_usb_host_destroy Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-tilegx.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-tilegx.c b/drivers/usb/host/ohci-tilegx.c index 1ae7b28..5888fc4 100644 --- a/drivers/usb/host/ohci-tilegx.c +++ b/drivers/usb/host/ohci-tilegx.c @@ -112,8 +112,10 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev) hcd = usb_create_hcd(ohci_tilegx_hc_driver, pdev-dev, dev_name(pdev-dev)); - if (!hcd) - return -ENOMEM; + if (!hcd){ + ret = -ENOMEM; + goto err_hcd; + } /* * We don't use rsrc_start to map in our registers, but seems like @@ -165,6 +167,7 @@ err_have_irq: err_no_irq: tilegx_stop_ohc(); usb_put_hcd(hcd); +err_hcd: gxio_usb_host_destroy(pdata-usb_ctx); return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/2] i2c: fix two wrong mem release
fix two wrong mem release * Changelog from v1: * exchange out_error_no_irq and out_error_pin_mux suggested by Sonic sonic.zh...@analog.com * add some new tag , make code cleanly Libo Chen (2): i2c: i2c-bfin-twi: don`t free peripheral before it init successful i2c: pxa: no need release_mem_region before request_mem_region successful drivers/i2c/busses/i2c-bfin-twi.c |2 +- drivers/i2c/busses/i2c-pxa.c | 13 - 2 files changed, 9 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/2] i2c: pxa: no need release_mem_region before request_mem_region successful
When kzalloc fail, there is no reason to release_mem_region fix confuse tag, add new tag: emem, eirq, edt and make it cleanly Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-pxa.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index ea6d45d..a9da954 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1104,18 +1104,18 @@ static int i2c_pxa_probe(struct platform_device *dev) if (ret 0) ret = i2c_pxa_probe_pdata(dev, i2c, i2c_type); if (ret 0) - goto eclk; + goto edt; res = platform_get_resource(dev, IORESOURCE_MEM, 0); irq = platform_get_irq(dev, 0); if (res == NULL || irq 0) { ret = -ENODEV; - goto eclk; + goto eirq; } if (!request_mem_region(res-start, resource_size(res), res-name)) { ret = -ENOMEM; - goto eclk; + goto emem; } i2c-adap.owner = THIS_MODULE; @@ -1207,9 +1207,12 @@ ereqirq: eremap: clk_put(i2c-clk); eclk: - kfree(i2c); -emalloc: release_mem_region(res-start, resource_size(res)); +emem: +eirq: +edt: + kfree(i2c); +emalloc: return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/2] i2c: i2c-bfin-twi: don`t free peripheral before it init successful
down out_error_no_irq. When platform_get_irq fail, no need to free peripheral Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-bfin-twi.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 05080c4..6617645 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c @@ -709,9 +709,9 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev) out_error_add_adapter: free_irq(iface-irq, iface); out_error_req_irq: -out_error_no_irq: peripheral_free_list((unsigned short *)pdev-dev.platform_data); out_error_pin_mux: +out_error_no_irq: iounmap(iface-regs_base); out_error_ioremap: out_error_get_res: -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 1/2] i2c: i2c-bfin-twi: don`t free peripheral before it init successful
On 2013/5/9 16:33, Zhang, Sonic wrote: Hi Libo, -Original Message- From: Libo Chen [mailto:libo.c...@huawei.com] Sent: Thursday, May 09, 2013 4:27 PM To: Zhang, Sonic; w...@the-dreams.de Cc: uclinux-dist-de...@blackfin.uclinux.org; linux-kernel@vger.kernel.org; linux- i...@vger.kernel.org; lize...@huawei.com; Libo Chen Subject: [PATCH v2 1/2] i2c: i2c-bfin-twi: don`t free peripheral before it init successful down out_error_no_irq. When platform_get_irq fail, no need to free peripheral Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/i2c/busses/i2c-bfin-twi.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 05080c4..6617645 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c @@ -709,9 +709,9 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev) out_error_add_adapter: free_irq(iface-irq, iface); out_error_req_irq: -out_error_no_irq: peripheral_free_list((unsigned short *)pdev-dev.platform_data); out_error_pin_mux: +out_error_no_irq: iounmap(iface-regs_base); out_error_ioremap: out_error_get_res: -- Sorry, but you didn't exchange as I suggested. Should be Hi Sonic, Look at peripheral_request_list() { u16 cnt; int ret; for (cnt = 0; per[cnt] != 0; cnt++) { ret = peripheral_request(per[cnt], label); if (ret 0) { for ( ; cnt 0; cnt--) peripheral_free(per[cnt - 1]); return ret; } } return 0; } When peripheral_request fail, it had called peripheral_free(). So there is no reason to call peripheral_free_list again. Did I miss something else? out_error_req_irq: -out_error_no_irq: +out_error_pin_mux: peripheral_free_list((unsigned short *)pdev-dev.platform_data); -out_error_pin_mux: +out_error_no_irq: Regards, Sonic -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND 4/4] usb: tilegx: fix memleak when create hcd fail
On 2013/5/10 2:02, Chris Metcalf wrote: On 5/9/2013 2:08 AM, Libo Chen wrote: When usb_create_hcd fail, we should call gxio_usb_host_destroy Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-tilegx.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) Thanks; taken into the tile tree. I also made the same change to ehci-tilegx.c. Hi Chris, Thanks reply, May be I miss. Please ignore this patch. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND 4/4] usb: tilegx: fix memleak when create hcd fail
On 2013/5/10 9:09, Libo Chen wrote: On 2013/5/10 2:02, Chris Metcalf wrote: On 5/9/2013 2:08 AM, Libo Chen wrote: When usb_create_hcd fail, we should call gxio_usb_host_destroy Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-tilegx.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) Thanks; taken into the tile tree. I also made the same change to ehci-tilegx.c. Hi Chris, Thanks reply, May be I miss. Please ignore this patch. Sorry, this patch is ok, no problem. . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 10/24] drivers/mfd/lpc_ich: Convert to module_pci_driver
On 2013/6/18 7:30, Samuel Ortiz wrote: Hi Libo, On Mon, May 27, 2013 at 10:28:56AM +0800, Libo Chen wrote: use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/mfd/lpc_ich.c | 13 + 1 files changed, 1 insertions(+), 12 deletions(-) Patch applied, thanks. Hi Samuel, This patch has beed merged to linux-next by Andrew Morton a...@linux-foundation.org Thanks, Libo Cheers, Samuel. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] tpm_tis: fix missing platform_driver_unregister
Add missing unregister tis_drv after register pdev fail Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/char/tpm/tpm_tis.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 8a41b6b..d5b0af4 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -884,8 +884,11 @@ static int __init init_tis(void) rc = platform_driver_register(tis_drv); if (rc 0) return rc; - if (IS_ERR(pdev=platform_device_register_simple(tpm_tis, -1, NULL, 0))) - return PTR_ERR(pdev); + pdev = platform_device_register_simple(tpm_tis, -1, NULL, 0); + if (IS_ERR(pdev) { + platform_driver_unregister(tis_drv); + return PTR_ERR(pdev); + } if((rc=tpm_tis_init(pdev-dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) { platform_device_unregister(pdev); platform_driver_unregister(tis_drv); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/2] msm: iommu: fix two mistake
From: libo.c...@huawei.com Sorry, I am not sure who this patch should be send to. Libo Chen (2): msm: iommu: add missing platform_device_unregister() in err case msm: iommu: no need kfree before kzalloc successful drivers/iommu/msm_iommu_dev.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] msm: iommu: add missing platform_device_unregister() in err case
From: libo.c...@huawei.com We have registered msm_iommu_driver first, and need unregister it when registered msm_iommu_ctx_driver fail Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/iommu/msm_iommu_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c index 8e8fb07..4351a2d 100644 --- a/drivers/iommu/msm_iommu_dev.c +++ b/drivers/iommu/msm_iommu_dev.c @@ -401,6 +401,7 @@ static int __init msm_iommu_driver_init(void) ret = platform_driver_register(msm_iommu_ctx_driver); if (ret != 0) { + platform_driver_unregister(msm_iommu_driver); pr_err(Failed to register IOMMU context driver\n); goto error; } -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] msm: iommu: no need kfree before kzalloc successful
From: libo.c...@huawei.com We don`t need to kfree drvdata before kzalloc successful Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/iommu/msm_iommu_dev.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c index 4351a2d..c6c6de1 100644 --- a/drivers/iommu/msm_iommu_dev.c +++ b/drivers/iommu/msm_iommu_dev.c @@ -293,20 +293,20 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev) int i, ret; if (!c || !pdev-dev.parent) { ret = -EINVAL; - goto fail; + goto out; } drvdata = dev_get_drvdata(pdev-dev.parent); if (!drvdata) { ret = -ENODEV; - goto fail; + goto out; } ctx_drvdata = kzalloc(sizeof(*ctx_drvdata), GFP_KERNEL); if (!ctx_drvdata) { ret = -ENOMEM; - goto fail; + goto out; } ctx_drvdata-num = c-num; ctx_drvdata-pdev = pdev; @@ -359,6 +359,7 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev) return 0; fail: kfree(ctx_drvdata); +out: return ret; } -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] scsi: megaraid: check kzalloc
we should check kzalloc, avoid to hit oops Change from v1: - put kzalloc outside of mutex Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/megaraid.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 846f475..cc599cc 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4150,6 +4150,12 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) if (!scmd) return -ENOMEM; + sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); + if (!sdev) { + scsi_free_command(GFP_KERNEL, scmd); + return -ENOMEM; + } + /* * The internal commands share one command id and hence are * serialized. This is so because we want to reserve maximum number of @@ -4160,7 +4166,6 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb = adapter-int_scb; memset(scb, 0, sizeof(scb_t)); - sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); scmd-device = sdev; memset(adapter-int_cdb, 0, sizeof(adapter-int_cdb)); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] scsi: megaraid: check kzalloc
On 2013/6/4 20:14, Tomas Henzl wrote: On 06/04/2013 11:33 AM, Libo Chen wrote: we should check kzalloc, avoid to hit oops Change from v1: - put kzalloc outside of mutex Signed-off-by: Libo Chen libo.c...@huawei.com Your patch looks fine to me: Acked-by: Tomas Henzl the...@redhat.com your ack is very helpfull for me. Thanks, Libo Cheers, Tomas . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] scsi: megaraid: check kzalloc
On 2013/5/29 23:03, Tomas Henzl wrote: On 05/24/2013 11:40 AM, Libo Chen wrote: we should check kzalloc, avoid to hit oops Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/megaraid.c |4 1 files changed, 4 insertions(+), 0 deletions(-) instead of checking scmd-device, sdev is more appropriate. diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 846f475..6b623cb 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4161,6 +4161,10 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) memset(scb, 0, sizeof(scb_t)); sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); +if (sdev) { +scsi_free_command(GFP_KERNEL, scmd); I think, that a mutex_unlock(adapter-int_mtx); is also needed Maybe just setting a rval = -ENOMEM and a jump to to some point below? tomash thanks for catching this. when kzalloc broken, fist unlock and then return. I will update later. Libo +return -ENOMEM; +} scmd-device = sdev; memset(adapter-int_cdb, 0, sizeof(adapter-int_cdb)); . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 1/2] mtd: bcm47: convert kzalloc to avoid invalid access
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member. So I use devm_kazlloc instead of kazlloc to avoid it. * Changelog: convert to devm_kzalloc Signed-off-by: Libo chen libo.c...@huawei.com Suggested-by: Andy Shevchenko andy.shevche...@gmail.com --- drivers/mtd/devices/bcm47xxsflash.c | 16 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c index 18e7761..2630d5c 100644 --- a/drivers/mtd/devices/bcm47xxsflash.c +++ b/drivers/mtd/devices/bcm47xxsflash.c @@ -54,11 +54,9 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) struct bcm47xxsflash *b47s; int err; - b47s = kzalloc(sizeof(*b47s), GFP_KERNEL); - if (!b47s) { - err = -ENOMEM; - goto out; - } + b47s = devm_kzalloc(pdev-dev, sizeof(*b47s), GFP_KERNEL); + if (!b47s) + return -ENOMEM; sflash-priv = b47s; b47s-bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); @@ -81,15 +79,10 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) err = mtd_device_parse_register(b47s-mtd, probes, NULL, NULL, 0); if (err) { pr_err(Failed to register MTD device: %d\n, err); - goto err_dev_reg; + return err; } return 0; - -err_dev_reg: - kfree(b47s-mtd); -out: - return err; } static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) @@ -98,7 +91,6 @@ static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) struct bcm47xxsflash *b47s = sflash-priv; mtd_device_unregister(b47s-mtd); - kfree(b47s); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND 2/2] mtd: bcm47: convert to module_platform_driver instead of init/exit
convert to module_platform_driver instead of init/exit Suggested-by: Andy Shevchenko andy.shevche...@gmail.com Signed-off-by: Libo chen libo.c...@huawei.com --- drivers/mtd/devices/bcm47xxsflash.c | 20 +--- 1 files changed, 1 insertions(+), 19 deletions(-) diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c index 2630d5c..54230cd 100644 --- a/drivers/mtd/devices/bcm47xxsflash.c +++ b/drivers/mtd/devices/bcm47xxsflash.c @@ -108,22 +108,4 @@ static struct platform_driver bcma_sflash_driver = { * Init **/ -static int __init bcm47xxsflash_init(void) -{ - int err; - - err = platform_driver_register(bcma_sflash_driver); - if (err) - pr_err(Failed to register BCMA serial flash driver: %d\n, - err); - - return err; -} - -static void __exit bcm47xxsflash_exit(void) -{ - platform_driver_unregister(bcma_sflash_driver); -} - -module_init(bcm47xxsflash_init); -module_exit(bcm47xxsflash_exit); +module_platform_driver(bcma_sflash_driver); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] scsi: megaraid: check kzalloc
On 2013/5/30 9:38, Libo Chen wrote: On 2013/5/29 23:03, Tomas Henzl wrote: On 05/24/2013 11:40 AM, Libo Chen wrote: we should check kzalloc, avoid to hit oops Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/megaraid.c |4 1 files changed, 4 insertions(+), 0 deletions(-) instead of checking scmd-device, sdev is more appropriate. diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 846f475..6b623cb 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4161,6 +4161,10 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) memset(scb, 0, sizeof(scb_t)); sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); + if (sdev) { + scsi_free_command(GFP_KERNEL, scmd); I think, that a mutex_unlock(adapter-int_mtx); is also needed Maybe just setting a rval = -ENOMEM and a jump to to some point below? tomash thanks for catching this. when kzalloc broken, fist unlock and then return. I will update later. I think we can put kzalloc outside of mutex_lock(adapter-int_mtx) ? phase: mutex_lock kzalloc kzalloc - mutex_lock Libo + return -ENOMEM; + } scmd-device = sdev; memset(adapter-int_cdb, 0, sizeof(adapter-int_cdb)); . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] scsi: Introduce a help function local_time_seconds() to simplify the getting time stamp operation
On 2013/5/29 17:33, Gu Zheng wrote: From 4d4caa16f3886ae910ad6dfe13353fc836f546cc Mon Sep 17 00:00:00 2001 From: Gu Zheng guz.f...@cn.fujitsu.com Date: Wed, 29 May 2013 17:34:22 +0900 Subject: [PATCH] driver/scsi: Introduce a help function local_time_seconds() to simplify the getting time stamp operation hi gu, next time, you can remove above info. thanks, Libo Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- drivers/scsi/3w-9xxx.c | 14 ++ drivers/scsi/3w-sas.c | 14 ++ include/scsi/scsi.h|9 + 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 5e1e12c..44b3ea8 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -374,8 +374,6 @@ out: /* This function will queue an event */ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_Header *header) { - u32 local_time; - struct timeval time; TW_Event *event; unsigned short aen; char host[16]; @@ -398,9 +396,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H memset(event, 0, sizeof(TW_Event)); event-severity = TW_SEV_OUT(header-status_block.severity__reserved); - do_gettimeofday(time); - local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60)); - event-time_stamp_sec = local_time; + event-time_stamp_sec = local_time_seconds(); event-aen_code = aen; event-retrieved = TW_AEN_NOT_RETRIEVED; event-sequence_id = tw_dev-error_sequence_id; @@ -479,11 +475,9 @@ out: static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) { u32 schedulertime; - struct timeval utc; TW_Command_Full *full_command_packet; TW_Command *command_packet; TW_Param_Apache *param; - u32 local_time; /* Fill out the command packet */ full_command_packet = tw_dev-command_packet_virt[request_id]; @@ -503,11 +497,7 @@ static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) param-parameter_id = cpu_to_le16(0x3); /* SchedulerTime */ param-parameter_size_bytes = cpu_to_le16(4); - /* Convert system time in UTC to local time seconds since last - Sunday 12:00AM */ - do_gettimeofday(utc); - local_time = (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60)); - schedulertime = local_time - (3 * 86400); + schedulertime = local_time_seconds() - (3 * 86400); schedulertime = cpu_to_le32(schedulertime % 604800); memcpy(param-data, schedulertime, sizeof(u32)); diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index c845bdb..69f1d8a 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -236,8 +236,6 @@ out: /* This function will queue an event */ static void twl_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_Header *header) { - u32 local_time; - struct timeval time; TW_Event *event; unsigned short aen; char host[16]; @@ -256,9 +254,7 @@ static void twl_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H memset(event, 0, sizeof(TW_Event)); event-severity = TW_SEV_OUT(header-status_block.severity__reserved); - do_gettimeofday(time); - local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60)); - event-time_stamp_sec = local_time; + event-time_stamp_sec = local_time_seconds(); event-aen_code = aen; event-retrieved = TW_AEN_NOT_RETRIEVED; event-sequence_id = tw_dev-error_sequence_id; @@ -444,11 +440,9 @@ out: static void twl_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) { u32 schedulertime; - struct timeval utc; TW_Command_Full *full_command_packet; TW_Command *command_packet; TW_Param_Apache *param; - u32 local_time; /* Fill out the command packet */ full_command_packet = tw_dev-command_packet_virt[request_id]; @@ -468,11 +462,7 @@ static void twl_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) param-parameter_id = cpu_to_le16(0x3); /* SchedulerTime */ param-parameter_size_bytes = cpu_to_le16(4); - /* Convert system time in UTC to local time seconds since last - Sunday 12:00AM */ - do_gettimeofday(utc); - local_time = (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60)); - schedulertime = local_time - (3 * 86400); + schedulertime = local_time_seconds() - (3 * 86400); schedulertime = cpu_to_le32(schedulertime % 604800); memcpy(param-data, schedulertime, sizeof(u32)); diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 66216c1..f3377ca 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -574,4 +574,13 @@ static inline __u32 scsi_to_u32(__u8 *ptr) return (ptr[0]24) + (ptr[1]16) + (ptr[2]8) + ptr[3]; }
[PATCH] menuconfig: print more info for symbol without prompts
From: Wengmeiling wengmeiling.w...@huawei.com When we search a config symbol, if it has no prompt the position of this symbol in the Kconfig file and it's dependencies are not printed. This can be inconvenient, especially when it's set to n and we want to find out why. the following is an example: before: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Selected by: X86 [=y] after: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Defined at arch/Kconfig:213 Selected by: X86 [=y] Signed-off-by: Weng Meiling wengmeiling.w...@huawei.com Signed-off-by: Libo Chen libo.c...@huawei.com --- scripts/kconfig/menu.c | 27 --- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index f3bffa3..826da66 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -515,13 +515,6 @@ static void get_prompt_str(struct gstr *r, struct property *prop, struct jump_key *jump; str_printf(r, _(Prompt: %s\n), _(prop-text)); - str_printf(r, _( Defined at %s:%d\n), prop-menu-file-name, - prop-menu-lineno); - if (!expr_is_yes(prop-visible.expr)) { - str_append(r, _( Depends on: )); - expr_gstr_print(prop-visible.expr, r); - str_append(r, \n); - } menu = prop-menu-parent; for (i = 0; menu != rootmenu i 8; menu = menu-parent) { bool accessible = menu_is_visible(menu); @@ -572,6 +565,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop, } /* + * get peoperty of type P_SYMBOL + */ +static struct property *get_symbol_prop(struct symbol *sym) +{ + struct property *prop = NULL; + + for_all_properties(sym, prop, P_SYMBOL) + break; + return prop; +} + +/* * head is optional and may be NULL */ void get_symbol_str(struct gstr *r, struct symbol *sym, @@ -595,6 +600,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, } for_all_prompts(sym, prop) get_prompt_str(r, prop, head); + prop = get_symbol_prop(sym); + str_printf(r, _( Defined at %s:%d\n), prop-menu-file-name, + prop-menu-lineno); + if (!expr_is_yes(prop-visible.expr)) { + str_append(r, _( Depends on: )); + expr_gstr_print(prop-visible.expr, r); + str_append(r, \n); + } hit = false; for_all_properties(sym, prop, P_SELECT) { if (!hit) { -- 1.7.1 . -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/4] usb: tilegx: fix memleak when create hcd fail
Hi Greg, On 2013/5/17 8:34, Greg KH wrote: On Thu, May 09, 2013 at 12:58:11PM +0800, Libo Chen wrote: From: Libo Chen chenlib...@gmail.com When usb_create_hcd fail, we should call gxio_usb_host_destroy Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/host/ohci-tilegx.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) This patch doesn't apply at all, care to refresh it? thanks, greg k-h . this patch has been merged to upstream by Chris Metcalf cmetc...@tilera.com. (commit: abab8761d095e0805879df48a8ba6ea7f8b31c5e) thanks, Libo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] usb: omap2430: fix memleak in err case
On 2013/5/15 19:55, Sergei Shtylyov wrote: Hello. On 15-05-2013 5:35, Libo Chen wrote: when omap_get_control_dev fail, we should release relational platform_device s/fail/fails/, s/relational/related/? Signed-off-by: Libo Chen libo.c...@huawei.com You've posted this to the wrong mailing list, linux-mips; devicetree-discuss also seems hardly related. WBR, Sergei Hi Sergei, Thank you for your remind. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] cdrom: gdrom: fix device number leak
without this patch, gdrom_major will leak when gd.cd_info alloc faild Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/cdrom/gdrom.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 4afcb65..5980cb9 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c @@ -830,9 +830,9 @@ probe_fail_cdrom_register: del_gendisk(gd.disk); probe_fail_no_disk: kfree(gd.cd_info); +probe_fail_no_mem: unregister_blkdev(gdrom_major, GDROM_DEV_NAME); gdrom_major = 0; -probe_fail_no_mem: pr_warning(Probe failed - error is 0x%X\n, err); return err; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] MIPS: drivers: fix clk leak
when gptu_r32 fail, we should put clk before return Signed-off-by: Libo Chen libo.c...@huawei.com --- arch/mips/lantiq/xway/gptu.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c index 9861c86..4fa577c 100644 --- a/arch/mips/lantiq/xway/gptu.c +++ b/arch/mips/lantiq/xway/gptu.c @@ -169,6 +169,8 @@ static int gptu_probe(struct platform_device *pdev) if (((gptu_r32(GPTU_ID) 8) 0xff) != GPTU_MAGIC) { dev_err(pdev-dev, Failed to find magic\n); gptu_hwexit(); + clk_disable(clk); + clk_put(clk); return -ENAVAIL; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 0/2] i2c: fix two wrong mem release
于 2013-5-17 17:43, Wolfram Sang 写道: On Thu, May 09, 2013 at 04:27:22PM +0800, Libo Chen wrote: fix two wrong mem release * Changelog from v1: * exchange out_error_no_irq and out_error_pin_mux suggested by Sonicsonic.zh...@analog.com * add some new tag , make code cleanly Thanks for the submission. I do think the proper solution would be to convert the drivers to use the devm_* mechanisms, though. You can check commit 857968434bb6dbda0911f38ec46b0c3d0c963771 (i2c: davinci: update to devm_* API) as a reference. Thanks, Wolfram Hi, Wolfram It is a good idea. I will learn about it. Thanks, Libo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] cdrom: gdrom: fix device number leak
repost with Jens Axboe ax...@kernel.dk added suggest by Tejun Heo t...@kernel.org without this patch, gdrom_major will leak when gd.cd_info alloc faild Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/cdrom/gdrom.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 4afcb65..5980cb9 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c @@ -830,9 +830,9 @@ probe_fail_cdrom_register: del_gendisk(gd.disk); probe_fail_no_disk: kfree(gd.cd_info); +probe_fail_no_mem: unregister_blkdev(gdrom_major, GDROM_DEV_NAME); gdrom_major = 0; -probe_fail_no_mem: pr_warning(Probe failed - error is 0x%X\n, err); return err; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] x86: msi-laptop: fix memleak
1. fix two visible mistakes: * when load_scm_model_init faild, we should call platform_device_del(msipf_device) * msipf_attribute_group should be remove in err case 2. change some tags, give them real meaning. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/platform/x86/msi-laptop.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) mode change 100644 = 100755 drivers/platform/x86/msi-laptop.c diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c old mode 100644 new mode 100755 index 6b22938..62f8030 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c @@ -1098,29 +1098,29 @@ static int __init msi_init(void) ret = platform_device_add(msipf_device); if (ret) - goto fail_platform_device1; + goto fail_device_add; if (quirks-load_scm_model (load_scm_model_init(msipf_device) 0)) { ret = -EINVAL; - goto fail_platform_device1; + goto fail_scm_model_init; } ret = sysfs_create_group(msipf_device-dev.kobj, msipf_attribute_group); if (ret) - goto fail_platform_device2; + goto fail_create_group; if (!quirks-old_ec_model) { if (threeg_exists) ret = device_create_file(msipf_device-dev, dev_attr_threeg); if (ret) - goto fail_platform_device2; + goto fail_create_attr; } else { ret = sysfs_create_group(msipf_device-dev.kobj, msipf_old_attribute_group); if (ret) - goto fail_platform_device2; + goto fail_create_attr; /* Disable automatic brightness control by default because * this module was probably loaded to do brightness control in @@ -1134,26 +1134,22 @@ static int __init msi_init(void) return 0; -fail_platform_device2: - +fail_create_attr: + sysfs_remove_group(msipf_device-dev.kobj, msipf_attribute_group); +fail_create_group: if (quirks-load_scm_model) { i8042_remove_filter(msi_laptop_i8042_filter); cancel_delayed_work_sync(msi_rfkill_dwork); cancel_work_sync(msi_rfkill_work); rfkill_cleanup(); } +fail_scm_model_init: platform_device_del(msipf_device); - -fail_platform_device1: - +fail_device_add: platform_device_put(msipf_device); - fail_platform_driver: - platform_driver_unregister(msipf_driver); - fail_backlight: - backlight_device_unregister(msibl_device); return ret; -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/3] fix x86 driver memleak
fix memleak or invalite point acesss about x86 platform drivers Libo Chen (3): x86: msi-laptop: fix memleak x86: asus-laptop: fix invalid point access x86 platform drivers: fix gpio leak drivers/platform/x86/asus-laptop.c | 1 - drivers/platform/x86/intel_pmic_gpio.c | 5 - drivers/platform/x86/msi-laptop.c | 24 ++-- 3 files changed, 14 insertions(+), 16 deletions(-) -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] x86 platform drivers: fix gpio leak
when request_irq faild, we should release gpiochip Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/platform/x86/intel_pmic_gpio.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 = 100755 drivers/platform/x86/intel_pmic_gpio.c diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c old mode 100644 new mode 100755 index 6f4b728..478c3a5 --- a/drivers/platform/x86/intel_pmic_gpio.c +++ b/drivers/platform/x86/intel_pmic_gpio.c @@ -288,7 +288,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) retval = request_irq(pg-irq, pmic_irq_handler, 0, pmic, pg); if (retval) { pr_warn(Interrupt request failed\n); - goto err; + goto fail_request_irq; } for (i = 0; i 8; i++) { @@ -299,6 +299,9 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) irq_set_chip_data(i + pg-irq_base, pg); } return 0; + +fail_request_irq: + gpiochip_remove(pg-chip); err: iounmap(pg-gpiointr); err2: -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] x86: asus-laptop: fix invalid point access
asus-name is null or point to const string,so it is not suitable to kfree it. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/platform/x86/asus-laptop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 0eea09c..8e268da 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1935,7 +1935,6 @@ fail_input: fail_backlight: asus_platform_exit(asus); fail_platform: - kfree(asus-name); kfree(asus); return result; -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 05/19] drivers/ust/renesas_usbhs: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/renesas_usbhs/common.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index cfd2050..0d98cd3 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -632,6 +632,7 @@ static const struct dev_pm_ops usbhsc_pm_ops = { static struct platform_driver renesas_usbhs_driver = { .driver = { .name = renesas_usbhs, + .owner = THIS_MODULE, .pm = usbhsc_pm_ops, }, .probe = usbhs_probe, -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 11/19] drivers/net/ethernet/natsemi: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/ethernet/natsemi/xtsonic.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c index c2e0256..9281781 100644 --- a/drivers/net/ethernet/natsemi/xtsonic.c +++ b/drivers/net/ethernet/natsemi/xtsonic.c @@ -315,6 +315,7 @@ static struct platform_driver xtsonic_driver = { .remove = xtsonic_device_remove, .driver = { .name = xtsonic_string, + .owner = THIS_MODULE, }, }; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 04/19] drivers/usb/dwc3: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/dwc3/core.c|1 + drivers/usb/dwc3/dwc3-exynos.c |1 + drivers/usb/dwc3/dwc3-omap.c |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c35d49d..570c2df 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -766,6 +766,7 @@ static struct platform_driver dwc3_driver = { .remove = dwc3_remove, .driver = { .name = dwc3, + .owner = THIS_MODULE, .of_match_table = of_match_ptr(of_dwc3_match), .pm = DWC3_PM_OPS, }, diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index a8afe6e..831aa81 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -219,6 +219,7 @@ static struct platform_driver dwc3_exynos_driver = { .remove = dwc3_exynos_remove, .driver = { .name = exynos-dwc3, + .owner = THIS_MODULE, .of_match_table = of_match_ptr(exynos_dwc3_match), .pm = DEV_PM_OPS, }, diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 34638b9..3aaf87f 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -468,6 +468,7 @@ static struct platform_driver dwc3_omap_driver = { .remove = dwc3_omap_remove, .driver = { .name = omap-dwc3, + .owner = THIS_MODULE, .of_match_table = of_dwc3_match, .pm = DEV_PM_OPS, }, -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 07/19] drivers/usb/gadget: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/usb/gadget/r8a66597-udc.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 0b742d1..3670e23 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -2017,6 +2017,7 @@ static struct platform_driver r8a66597_driver = { .remove = __exit_p(r8a66597_remove), .driver = { .name = (char *) udc_name, + .owner = THIS_MODULE, }, }; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 16/19] drivers/net/wan: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/net/wan/ixp4xx_hss.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index fc9d11d..db2d775 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c @@ -1391,6 +1391,7 @@ static int hss_remove_one(struct platform_device *pdev) static struct platform_driver ixp4xx_hss_driver = { .driver.name= DRV_NAME, + .driver.owner = THIS_MODULE, .probe = hss_init_one, .remove = hss_remove_one, }; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 14/19] drivers/net/wireless/brcm80211/brcmfmac: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen libo.c...@huawei.com --- .../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 44fa0cd..11400b3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c @@ -606,7 +606,8 @@ static int brcmf_sdio_pd_remove(struct platform_device *pdev) static struct platform_driver brcmf_sdio_pd = { .remove = brcmf_sdio_pd_remove, .driver = { - .name = BRCMFMAC_SDIO_PDATA_NAME + .name = BRCMFMAC_SDIO_PDATA_NAME, + .owner = THIS_MODULE, } }; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/