From: Sergey Shtylyov <sergei.shtylyov@gmail.com>
To: Zhaoyang Yu <2426767509@qq.com>,
daniel@zonque.org, haojian.zhuang@gmail.com,
robert.jarzmik@free.fr, gregkh@linuxfoundation.org
Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: pxa27x_udc: check return value of clk_enable
Date: Sun, 1 Mar 2026 19:37:02 +0300 [thread overview]
Message-ID: <554c1dc9-cb75-4777-ad98-97243808245d@gmail.com> (raw)
In-Reply-To: <tencent_05D6B6FBD5DE2A537EBE395A85B021506009@qq.com>
On 3/1/26 7:23 PM, Zhaoyang Yu wrote:
> clk_enable() may fail according to the API contract.
> Previously, udc_enable() ignored its return value.
> This patch checks the return value and logs an error
> without continuing initialization if clk_enable fails.
>
> Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
> ---
> drivers/usb/gadget/udc/pxa27x_udc.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
> index 897f53601b5b..69fcecaf6061 100644
> --- a/drivers/usb/gadget/udc/pxa27x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa27x_udc.c
> @@ -1696,7 +1696,13 @@ static void udc_enable(struct pxa_udc *udc)
> if (udc->enabled)
> return;
>
> - clk_enable(udc->clk);
> + int ret;
Please don't declare variables amidst of a function. IIRC, the Linux coding
style doesn't allow for this C++-ism...
[...]
MBR, Sergey
next prev parent reply other threads:[~2026-03-01 16:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 16:23 [PATCH] USB: pxa27x_udc: check return value of clk_enable Zhaoyang Yu
2026-03-01 16:37 ` Sergey Shtylyov [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-03-01 16:55 Zhaoyang Yu
2026-03-11 12:49 ` Greg KH
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=554c1dc9-cb75-4777-ad98-97243808245d@gmail.com \
--to=sergei.shtylyov@gmail.com \
--cc=2426767509@qq.com \
--cc=daniel@zonque.org \
--cc=gregkh@linuxfoundation.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/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