On 10/20/2015 06:30 PM, Anton.Glukhov wrote:
quoted
quoted
+ clk_disable_unprepare(priv->clk);
+ priv->clk = NULL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iounmap(priv->base);
release_mem_region(res->start, resource_size(res));
@@ -1009,7 +1010,7 @@ static int ti_hecc_suspend(struct platform_device *pdev, pm_message_t state)
hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
priv->can.state = CAN_STATE_SLEEPING;
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
return 0;
}
@@ -1019,7 +1020,7 @@ static int ti_hecc_resume(struct platform_device *pdev)
struct net_device *dev = platform_get_drvdata(pdev);
struct ti_hecc_priv *priv = netdev_priv(dev);
- clk_enable(priv->clk);
+ clk_prepare_enable(priv->clk);
please add error checking.
Why it wasn't added with clk_enable? Is it bug? I'm confused here, because in so many drivers
there is no checking err after clk_enable or clk_prepare_enable. Maybe I missed something...
Could you clarify this part please?
I wouldn't call it a bug in the original driver, it probably slipped
through the review or I didn't know better.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |