Category: Linux

pinctrl: pistachio: Drop pinctrl_unregister for devm_ registered device

Author: Wei Yongjun <weiyj.lk@gmail.com> It’s not necessary to unregister pin controller device registered with devm_pinctrl_register() and using pinctrl_unregister() leads to a double free. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Signed-off-by: Linus Walleij — drivers/pinctrl/pinctrl-pistachio.c | 9 +——– 1 file changed, 1 insertion(+), 8 deletions(-)   diff –git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index c6d410e..7bad200 …

Continue reading

pinctrl: meson: Drop pinctrl_unregister for devm_ registered device

Author: Wei Yongjun <weiyj.lk@gmail.com> It’s not necessary to unregister pin controller device registered with devm_pinctrl_register() and using pinctrl_unregister() leads to a double free. This is detected by Coccinelle semantic patch. Fixes: e649f7ec8c5f (“pinctrl: meson: Use devm_pinctrl_register() for pinctrl registration”) Signed-off-by: Wei Yongjun Reviewed-by: Dmitry Torokhov Acked-by: Kevin Hilman Signed-off-by: Linus Walleij — drivers/pinctrl/meson/pinctrl-meson.c | 8 …

Continue reading

watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()

Author: Wei Yongjun <weiyj.lk@gmail.com> Add missing platform_set_drvdata() in gpio_wdt_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck — drivers/watchdog/gpio_wdt.c | 2 ++ 1 file changed, 2 insertions(+)   diff –git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c index ba066e4..93457ca 100644 — …

Continue reading

power_supply: tps65217-charger: fix missing platform_set_drvdata()

Author: Wei Yongjun <weiyj.lk@gmail.com> Add missing platform_set_drvdata() in tps65217_charger_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Fixes: 3636859b280c (“power_supply: Add support for tps65217-charger”) Signed-off-by: Wei Yongjun Signed-off-by: Sebastian Reichel — drivers/power/tps65217_charger.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/drivers/power/tps65217_charger.c b/drivers/power/tps65217_charger.c index 73dfae4..4c56e54 100644 — …

Continue reading

usb: phy: omap-otg: Fix missing platform_set_drvdata() in omap_otg_probe()

Author: Wei Yongjun <weiyj.lk@gmail.com> Add missing platform_set_drvdata() in omap_otg_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi — drivers/usb/phy/phy-omap-otg.c | 2 ++ 1 file changed, 2 insertions(+)   diff –git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c index 6f6d2a7..6523af4 100644 — a/drivers/usb/phy/phy-omap-otg.c +++ b/drivers/usb/phy/phy-omap-otg.c @@ -140,6 +140,8 @@ …

Continue reading

usb: dwc3: fix missing platform_set_drvdata() in dwc3_of_simple_probe()

Author: Wei Yongjun <weiyj.lk@gmail.com> Add missing platform_set_drvdata() in dwc3_of_simple_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi — drivers/usb/dwc3/dwc3-of-simple.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 9743353..e56d59b 100644 — a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -61,6 +61,7 @@ …

Continue reading

Input: synaptics-rmi4 – do not check for NULL when calling of_node_put()

Author: Markus Elfring <elfring@users.sourceforge.net> The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Dmitry Torokhov — drivers/input/rmi4/rmi_bus.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-)   diff …

Continue reading

rtc: at91sam9: Fix missing spin_lock_init()

Author: Wei Yongjun <weiyj.lk@gmail.com> The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Signed-off-by: Alexandre Belloni — drivers/rtc/rtc-at91sam9.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index 99732e6..7418a76 100644 — a/drivers/rtc/rtc-at91sam9.c +++ …

Continue reading

thermal: clock_cooling: Fix missing mutex_init()

Author: Wei Yongjun <weiyj.lk@gmail.com> The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Signed-off-by: Zhang Rui — drivers/thermal/clock_cooling.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/drivers/thermal/clock_cooling.c b/drivers/thermal/clock_cooling.c index 1b4ff0f..ed5dd0e 100644 — a/drivers/thermal/clock_cooling.c +++ …

Continue reading

libnvdimm-btt: Delete an unnecessary check before the function call “__nd_device_register”

Author: Markus Elfring <elfring@users.sourceforge.net> The __nd_device_register() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Dan Williams — drivers/nvdimm/btt_devs.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff …

Continue reading