All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Anton.Glukhov" <anton.a.glukhov@gmail.com>, linux-can@vger.kernel.org
Cc: hs@denx.de, netdev@vger.kernel.org
Subject: Re: [PATCH v2] net, can, ti_hecc: fix a run time warn_on.
Date: Tue, 20 Oct 2015 21:11:19 +0200	[thread overview]
Message-ID: <562691D7.30602@pengutronix.de> (raw)
In-Reply-To: <56266C0B.1040006@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

On 10/20/2015 06:30 PM, Anton.Glukhov wrote:
>>> +	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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

      reply	other threads:[~2015-10-20 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 14:39 [PATCH v2] net, can, ti_hecc: fix a run time warn_on Anton Glukhov
2015-10-20 14:46 ` Marc Kleine-Budde
2015-10-20 16:30   ` Anton.Glukhov
2015-10-20 19:11     ` Marc Kleine-Budde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562691D7.30602@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=anton.a.glukhov@gmail.com \
    --cc=hs@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.