From: Dan Carpenter <error27@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-usb@vger.kernel.org
Subject: [bug report] usb: udc: pxa: remove unused platform_data
Date: Thu, 21 May 2026 11:13:58 +0300 [thread overview]
Message-ID: <ag6-xhfFjb5NpXQz@stanley.mountain> (raw)
Hello Arnd Bergmann,
Commit 25bd55f46032 ("usb: udc: pxa: remove unused platform_data")
from Apr 27, 2026 (linux-next), leads to the following Smatch static
checker warning:
drivers/usb/gadget/udc/pxa27x_udc.c:2398 pxa_udc_probe()
warn: 'udc->gpiod' is not an error pointer
drivers/usb/gadget/udc/pxa27x_udc.c
2372 static int pxa_udc_probe(struct platform_device *pdev)
2373 {
2374 struct pxa_udc *udc = &memory;
2375 int retval = 0;
2376
2377 udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
2378 if (IS_ERR(udc->gpiod))
2379 return PTR_ERR(udc->gpiod);
The error handling moved to here.
2380
2381 udc->regs = devm_platform_ioremap_resource(pdev, 0);
2382 if (IS_ERR(udc->regs))
2383 return PTR_ERR(udc->regs);
2384 udc->irq = platform_get_irq(pdev, 0);
2385 if (udc->irq < 0)
2386 return udc->irq;
2387
2388 udc->dev = &pdev->dev;
2389 if (of_have_populated_dt()) {
2390 udc->transceiver =
2391 devm_usb_get_phy_by_phandle(udc->dev, "phys", 0);
2392 if (IS_ERR(udc->transceiver))
2393 return PTR_ERR(udc->transceiver);
2394 } else {
2395 udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
2396 }
2397
--> 2398 if (IS_ERR(udc->gpiod)) {
2399 dev_err(&pdev->dev, "Couldn't find or request D+ gpio : %ld\n",
2400 PTR_ERR(udc->gpiod));
2401 return PTR_ERR(udc->gpiod);
2402 }
This is dead code.
2403 if (udc->gpiod)
2404 gpiod_direction_output(udc->gpiod, 0);
The comments say udc->gpiod can't be NULL either. Was
devm_gpiod_get_optional() intended?
2405
2406 udc->clk = devm_clk_get(&pdev->dev, NULL);
2407 if (IS_ERR(udc->clk))
2408 return PTR_ERR(udc->clk);
2409
2410 retval = clk_prepare(udc->clk);
2411 if (retval)
2412 return retval;
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
next reply other threads:[~2026-05-21 8:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 8:13 Dan Carpenter [this message]
2026-05-26 10:51 ` [bug report] usb: udc: pxa: remove unused platform_data Arnd Bergmann
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=ag6-xhfFjb5NpXQz@stanley.mountain \
--to=error27@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-usb@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