From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Markus Elfring <Markus.Elfring@web.de>,
linux-usb@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
Al Cooper <alcooperx@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Justin Chen <justin.chen@broadcom.com>,
Neill Kapron <nkapron@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: bdc: Use devm_clk_get_optional_enabled() in bdc_probe()
Date: Thu, 19 Nov 2026 21:19:16 +0100 [thread overview]
Message-ID: <111e6c03-017f-47f2-a941-cba45697c1e4@wanadoo.fr> (raw)
In-Reply-To: <07112f96-430c-4109-9aca-e5d17e333d67@web.de>
Le 19/11/2026 à 20:06, Markus Elfring a écrit :
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 19 Nov 2026 20:00:07 +0100
>
> Reuse existing functionality from devm_clk_get_optional_enabled()
> instead of keeping duplicate source code.
>
> The source code was transformed by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/usb/gadget/udc/bdc/bdc_core.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
> index 5149c98bf9bf..ce09327250f4 100644
> --- a/drivers/usb/gadget/udc/bdc/bdc_core.c
> +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
> @@ -530,16 +530,10 @@ static int bdc_probe(struct platform_device *pdev)
> }
> }
>
> - bdc->clk = devm_clk_get_optional(dev, "sw_usbd");
> + bdc->clk = devm_clk_get_optional_enabled(dev, "sw_usbd");
> if (IS_ERR(bdc->clk))
> return PTR_ERR(bdc->clk);
>
> - ret = clk_prepare_enable(bdc->clk);
> - if (ret) {
> - dev_err(dev, "could not enable clock\n");
> - return ret;
> - }
> -
> ret = bdc_phy_init(bdc);
> if (ret) {
> dev_err(bdc->dev, "BDC phy init failure:%d\n", ret);
Hi,
this patch is wrong because the remove function and the error handling
path of the probe need to be updated.
CJ
prev parent reply other threads:[~2026-11-19 20:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:06 Markus Elfring
2026-11-19 20:19 ` Christophe JAILLET [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=111e6c03-017f-47f2-a941-cba45697c1e4@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=Markus.Elfring@web.de \
--cc=alcooperx@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=justin.chen@broadcom.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nkapron@google.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
all inboxes | Powered by JetHome®