On Sun, 2026-02-15 at 16:58 +0100, Marek Vasut wrote:
> On 2/15/26 1:35 PM, Siddharth Vadapalli wrote:
> 
> [...]
> 
> > +static int cdns3_get_otg_mode(struct udevice *parent, enum usb_dr_mode 
> > *mode)
> > +{
> > +   /* Create a temporary child device for using devfdt_remap_addr_name() */
> > +   struct udevice child = {
> > +           .parent = parent,
> > +   };
> > +   struct cdns3 cdns, *cdnsp;
> > +   void __iomem *otg_regs;
> > +   int vbus;
> 
> [...]
> 
> > +   /* Use VBUS Valid to determine role */
> > +   vbus = !!(readl(&cdnsp->otg_regs->sts) & OTGSTS_VBUS_VALID);
> > +   if (vbus)
> The double-negation is not needed here, simply use:
> 
> if (readl(&cdnsp->otg_regs->sts) & OTGSTS_VBUS_VALID) {
> ...

I have implemented the above and have posted the v4 patch at:
https://lore.kernel.org/r/[email protected]
Thank you for the feedback.

Regards,
Siddharth.

Reply via email to