From: Felipe Balbi <balbi@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>, Peter Chen <peter.chen@nxp.com>
Cc: mathias.nyman@intel.com, linux-usb@vger.kernel.org,
linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com,
jun.li@nxp.com
Subject: Re: [PATCH v4 1/9] usb: cdns3: introduce cdns3_set_phy_power API
Date: Mon, 07 Sep 2020 10:29:16 +0300 [thread overview]
Message-ID: <87ft7u11v7.fsf@kernel.org> (raw)
In-Reply-To: <20200703070044.GB2220026@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]
Greg KH <gregkh@linuxfoundation.org> writes:
> On Fri, Jul 03, 2020 at 02:26:45PM +0800, Peter Chen wrote:
>> Since we have both USB2 and USB3 PHYs for cdns3 controller, it is
>> better we have a unity API to handle both USB2 and USB3's power, it
>> could simplify code for error handling and further power management
>> implementation.
>>
>> Reviewed-by: Jun Li <jun.li@nxp.com>
>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>> ---
>> drivers/usb/cdns3/core.c | 44 ++++++++++++++++++++++++++--------------
>> 1 file changed, 29 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
>> index 19bbb5b7e6b6..bfd09aa98c12 100644
>> --- a/drivers/usb/cdns3/core.c
>> +++ b/drivers/usb/cdns3/core.c
>> @@ -384,6 +384,28 @@ static int cdns3_role_set(struct usb_role_switch *sw, enum usb_role role)
>> return ret;
>> }
>>
>> +static int cdns3_set_phy_power(struct cdns3 *cdns, bool on)
>
> Please just make function calls self-describing, instead of having to
> try to remember what a specific flag means. This isn't as bad as some
> functions, but the general idea remains, this should be 2 functions:
> set_phy_power_off()
> set_phy_power_on()
>
> no need for the cdns3_ prefix, it's a static function.
the cdns3_ prefix helps when using function trace or function graph
trace. It's a lot easier to say "trace anything matching cdns3_*" than
it is to remember each function ;-)
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
next prev parent reply other threads:[~2020-09-07 7:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 6:26 [PATCH v4 0/9] usb: some PM changes for cdns3 and xhci-plat Peter Chen
2020-07-03 6:26 ` [PATCH v4 1/9] usb: cdns3: introduce cdns3_set_phy_power API Peter Chen
2020-07-03 7:00 ` Greg KH
2020-07-03 7:16 ` Peter Chen
2020-07-03 7:23 ` Greg KH
2020-07-03 7:31 ` Peter Chen
2020-09-07 7:29 ` Felipe Balbi [this message]
2020-07-03 6:26 ` [PATCH v4 2/9] usb: cdns3: add runtime PM support Peter Chen
2020-07-03 6:26 ` [PATCH v4 3/9] usb: cdns3: imx: add glue layer runtime pm implementation Peter Chen
2020-07-05 7:07 ` kernel test robot
2020-07-03 6:26 ` [PATCH v4 4/9] usb: host: xhci-plat: add platform data support Peter Chen
2020-07-03 6:26 ` [PATCH v4 5/9] usb: host: xhci-plat: add .suspend_quirk for struct xhci_plat_priv Peter Chen
2020-07-03 6:26 ` [PATCH v4 6/9] usb: host: xhci-plat: delete the unnecessary code Peter Chen
2020-07-03 6:26 ` [PATCH v4 7/9] usb: host: xhci-plat: add priv quirk for skip PHY initialization Peter Chen
2020-07-03 6:26 ` [PATCH v4 8/9] usb: cdns3: host: add .suspend_quirk for xhci-plat.c Peter Chen
2020-07-03 6:26 ` [PATCH v4 9/9] usb: cdns3: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT Peter Chen
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=87ft7u11v7.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jun.li@nxp.com \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=pawell@cadence.com \
--cc=peter.chen@nxp.com \
--cc=rogerq@ti.com \
/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;
as well as URLs for NNTP newsgroup(s).