From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Shenwei Wang <Shenwei.Wang@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Fabio Estevam <festevam@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] Serial: imx: add dev_pm_ops to support suspend to ram/disk
Date: Thu, 30 Jul 2015 11:34:49 +0200 [thread overview]
Message-ID: <20150730113449.6c4743f2@ipc1.ka-ro> (raw)
In-Reply-To: <CY1PR0301MB0843EC6EA393B4E5BC15FB9C838B0@CY1PR0301MB0843.namprd03.prod.outlook.com>
Hi,
> > -----Original Message-----
> > From: Fabio Estevam [mailto:festevam@gmail.com]
> > Sent: 2015年7月29日 17:11
> > To: Wang Shenwei-B38339
> > Cc: Greg Kroah-Hartman; linux-arm-kernel@lists.infradead.org;
> > linux-serial@vger.kernel.org
> > Subject: Re: [PATCH v3 1/1] Serial: imx: add dev_pm_ops to support suspend to
> > ram/disk
> >
> > On Wed, Jul 29, 2015 at 6:54 PM, Shenwei Wang <Shenwei.Wang@freescale.com>
> > wrote:
> >
> > > I am very interesting to know if you could provide an example
> > > condition that may cause clk_enable failed in this callback function?
> >
> > Let's check clk_enable definition:
> >
> > int clk_enable(struct clk *clk)
> > {
> > unsigned long flags;
> > int ret;
> >
> > if (!clk)
> > return 0;
> >
> > flags = clk_enable_lock();
> > ret = clk_core_enable(clk->core);
> > clk_enable_unlock(flags);
> >
> > return ret;
> > }
> >
> > So if I see it right it returns 'int' not 'void' ;-)
>
> Actually, the function shows even if it is in error status like the parameter "clk" is null the return value is zero.
> Inside the function "clk_core_enable", if everything goes smooth, it still returns zero.
>
A NULL clk is a valid clk per definition.
> Moreover, this patch does not care about the return value of clk_enable, whatever value it returns, the following codes keep
> the same.
>
Nevertheless it would be good to inform the user of a failure,
since that may affect the system's stability after returning from
suspend.
Even if the current implementation of a function cannot return an error
code in some specific circumstance, that doesn't mean that this will be
always the case. Thus, checking the return code and acting upon it is
always advisable.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2015-07-30 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 20:58 [PATCH v3 1/1] Serial: imx: add dev_pm_ops to support suspend to ram/disk Shenwei Wang
2015-07-29 21:21 ` Fabio Estevam
2015-07-29 21:41 ` Shenwei Wang
2015-07-29 21:45 ` Fabio Estevam
2015-07-29 21:54 ` Shenwei Wang
2015-07-29 22:11 ` Fabio Estevam
2015-07-30 2:45 ` Shenwei Wang
2015-07-30 9:34 ` Lothar Waßmann [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=20150730113449.6c4743f2@ipc1.ka-ro \
--to=lw@karo-electronics.de \
--cc=Shenwei.Wang@freescale.com \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox